Frage im Vorstellungsgespräch bei Amazon

Something on data structures and algorithms. Using map will solve the problem