Given a 2-D maze, you are required to navigate your robot through the maze from source to destination.
Example maze:
S 0 0 0 1
0 1 1 E 0
0 1 0 0 0where
0 = empty
1 = wall
S = starting point
E = end point
The robot carries X dynamites and can use <= X dynamites to blow away wall nodes in the maze, e.g. when dynamites = 3 : robot can bomb 3 wall nodes.
Allowed directions for robot to move: up, down, left, right.
Given the maze M, starting & ending point S, E, and the number of dynamites X, find the shortest path from S to E.