Pregunta de entrevista de Amazon

Two programming tests, randomly determined.