Google interview question

Hash map leet code interview problem