Pregunta de entrevista de Toptal

solving problems with data structures