Pregunta de entrevista de Roche

I was a medium leetcode hashmap problem.