Consider a rat placed at (0, 0) in a square matrix of order N * N. It has to reach the destination at (N - 1, N - 1). Find all possible paths that the rat can take to reach from source to destination. The directions in which the rat can move are βUβ(up), βDβ(down), βLβ (left), βRβ (right). Value 0 at a cell in the matrix represents that it is blocked and rat cannot move to it while value 1 at a cell in the matrix represents that rat can be travel through it.
Note: In a path, no cell can be visited more than one time.
ATTEMPT LINK:https://ide.geeksforgeeks.org/dBWq9968ns
Please help me understand how the code is wrong.