Meta interview question

depth-first search in a matrix.