Pregunta de entrevista de Lutron Eletronics

Technical Question - solved using hashmap/set