Visa Inc. interview question

Problem with DFS inside a matrix