Deutsche Bank interview question

Two problems using a hash table, one using a greedy approach.