Roche Interview Question

I was a medium leetcode hashmap problem.