Pregunta de entrevista de Goldman Sachs

The question was based on Frequency count, usually solved using Hashmaps