Pregunta de entrevista de Amazon

Two pointer question about how it works