Capital One interview question

Using a hashmap to solve problem