Problem of the day
The first line of input contains an integer 'N' representing the dimension of the maze.
The next 'N' lines of input contain 'N' space-separated integers representing the type of the cell.
For each test case, return the path from the start position to the destination position and only cells that are part of the solution path should be 1, rest all cells should be 0.
Output for every test case will be printed in a separate line.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= N <= 10
0 <= MAZE[i][j] <=1
Where 'MAZE[i][j]' denotes the value in the cell of 'MAZE'.
Time Limit: 1 sec
3
1 0 1
1 0 1
1 1 1
1 0 0 1 0 0 1 1 1
Only 1 path is possible which contains coordinate < (1,1), (2,1), (3,1), (3,2) and (3,3) >
So our path matrix will look like this:
1 0 0
1 0 0
1 1 1
Which is returned from left to right and then top to bottom in one line.
2
1 0
0 1
[Blank]
As no path is possible to the last cell, a blank vector will be returned and nothing is printed.