


Given maze: {[0, 0, 1], [1, 0, 0], [1, 0, 0]}
Starting point: [2, 2]
Destination: [0, 0]
For the above example maze will look like this:

So, we can see there are 2 ways for Ninja to reach destination(D), from the starting point(SP). They are: [left -> up -> left] and [up -> left -> up -> left].
So, you need to print true.
The first line contains an integer ‘T’ which denotes the number of test cases.
The first line of each test case contains two space-separated integers ‘M’ and ‘N’ denoting the dimensions of the maze.
The next ‘M’ lines contain ‘N’ space-separated integers each denoting the maze.
The next line of each test case contains two space-separated integers ‘startX’ and ‘startY’ denoting the coordinates of the starting point.
The last line of each test case contains two space-separated integers ‘destX’ and ‘destY’ denoting the coordinates of the destination.
For each test case, print a single line containing a single string containing ‘True’ if it is possible to reach the destination from the starting point and ‘False’ if it is not possible.
The output of each 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 <=T <= 50
1 <= M,N <= 100
0 <= MAZE[ i ] [ j ] <= 1
Where MAZE[ i ][ j ] is the value of the maze. The starting point and destination will always lie in the maze and will be in empty spaces.
Time limit: 1 sec.
We will store all the four directions { (0,1) (0,-1) ( 1,0) ( -1,0 ) )} in 2-d array.
There will be many cases in which we will stop at a cell that is already explored. In order to not explore that cell again, we will maintain an extra array ‘visited’.
Algorithm