Citi interview question

DFS/BFS in a 2D matrix