Sponsored
Use these hints if you're stuck. Try solving on your own first.
Start DFS from the node (0, 0) and follow the path till you stop.
When you reach a cell and cannot move anymore check that this cell is (m - 1, n - 1) or not.
Solve with full IDE support and test cases