IBM Interview Question

cool greedy and hash map