In Rat in maze problem, there is a given maze of size N x N. The source and the destination location is top-left cell and bottom right cell respectively. Some cells are valid to move and some cells are blocked. If one rat starts moving from start vertex to destination vertex, we have to find that is there any way to complete the path, if it is possible then mark the correct path for the rat.
The maze is given using a binary matrix, where it is marked with 1, it is a valid path, otherwise 0 for a blocked cell.
In Rat in maze problem, there is a given maze of size N x N. The source and the destination location is top-left cell and bottom right cell respectively. Some cells are valid to move and some cells are blocked. If one rat starts moving from start vertex to destination vertex, we have to find that is there any way to complete the path, if it is possible then mark the correct path for the rat.
The maze is given using a binary matrix, where it is marked with 1, it is a valid path, otherwise 0 for a blocked cell.