A rat is standing in the starting block mat[0][0] of a maze, a N*N matrix named as mat[N-1][N-1]. It has to reach to the end of the matrix, mat[N-1][N-1]. In the maze matrix, 0 means the block is a dead end and 1 means the block can be used in the path from source to destination. It can move in the following directions.
The shortest path in the maze has: 8 nodes
Comments