Pregunta de entrevista de Amazon

Aptitude based question.