Pregunta de entrevista de Amazon Lab126

Nothing unexpected. Normal algorithm and design questions.