Pregunta de entrevista de BaxEnergy

A very simple algorithm question.