two test cases are failing why?
Rat_in_a_maze__
Maintain a visited array along with the solution array , and check the following conditions ,
if(visited[i][j])
{
return false;
}
and after that
visited[i][j]=1;
if(j+1<=M && !visited[i][j+1])
{
bool rightSuccess=ratmaze(maze,i,j+1,N,M);
if(rightSuccess==true)
{
return true;
}
}
do this for downwards also, and then try to submit…