Amazon Interview Question

Hashmap problems for both leetcodes