Pergunta de entrevista da empresa Terralogic

The coding question was from a string and can be solved using hashmap.