Pregunta de entrevista de Walmart Global Tech

Two pointer problem based on array