Recursive backtracking algorithm to explore exploring possible paths in a land with mines and walls. Backtracking problem