Pregunta de entrevista de Promise Robotics

Simple leetcode question. Two pointer question.