Google interview question

LeetCode easy string and Hashmap question