Pregunta de entrevista de Apple

Data structure and problem solving