Google interview question

Had to implement BFS in an mxn matrix