Pregunta de entrevista de Amazon

Solved a complex problem simply?