Goldman Sachs interview question

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