Pregunta de entrevista de Amazon

Leetcode easy, something to do with hashmaps