Pergunta de entrevista da empresa Promise Robotics

Simple leetcode question. Two pointer question.