Pregunta de entrevista de Amazon

2 Complex algorithm to solve under 1 hour