Pregunta de entrevista de Zoom Communications

Leetcode hashmap medium question. I dont remember exactly.