Domanda di colloquio di Amazon

Coding question, hashmap followed by some changes.