Pregunta de entrevista de Apple

Coding question on hashmaps and some other datastructure