Capital One Interview Question

Using a hashmap to solve problem