Pergunta de entrevista da empresa Walmart Global Tech

Two pointer problem based on array