Pregunta de entrevista de Pinterest

Coding question which involved hashmap.