Pregunta de entrevista de SIMON Markets

Standard data structures & algorithms question.