Roche interview question

I was a medium leetcode hashmap problem.