In this challenge, you are given a maze represented by a 2D grid. Each cell in the grid contains either a 0 (indicating a free space) or a 1 (indicating a wall). Your task is to find a path from the top-left corner (start) to the bottom-right corner (finish) using backtracking. You can move up, down, left, or right. If no valid path exists, return an empty list.
For the following maze:
[[0, 0, 1],
[1, 0, 0],
[1, 1, 0]]
A valid path (if one exists) might be:
[(0,0), (0,1), (1,1), (1,2), (2,2)]
Below is some language-agnostic starter code to help you get started.
solveMaze(maze)
(row, col)
representing the path from start to finish. Return an empty list if no path exists.Happy coding and enjoy the spirit of problem solving this season!