Here’s the link to my code https://ide.codingblocks.com/s/80749
I’m getting runtime error in some test cases. Please assist?
Rat in a maze problem at last cell
In this question, you are supposed to use a visited array also which will keep track of the previous path visited, and before going downwards or towards right, check this condition:
if(j+1<=M && !visited[i][j+1])
{
bool rightSuccess=ratmaze(maze,i,j+1,N,M);
if(rightSuccess==true)
{
return true;
}
}
Do the same for right values as well
Thanks a lot for your help.
But the problem wasn’t my logic, I just had to change the array sizes from 100 to 1000.