Pinterest Interview Question

Coding question which involved hashmap.