Domanda di colloquio di Apple

Coding question on hashmaps and some other datastructure