Google Interview Question

2D array and Hashmap. Also recurssion