Pregunta de entrevista de think-cell

Data structures question, coding challenge