Bloomberg interview question

problems that required hash maps to solve