2 test cases are failing in the problem rat in maze
but i think i have done it line number 25
@Ashu1318 no, in line 22 you visited right side, and in line 23 you visited down side anyway, dont do that. Visiti downside only if right side returned false, else return true at that point itself
still not passing testcases i think i have done somthing wrong
@Ashu1318 the condition should come directly after you visited rs. The point is you DONT have to visit downside if rs returned true.

@Ashu1318 modify the code like this
bool rs=ratinmaze(maze,sol,i,j+1,n,m);
if (rs) {
return true;
}
bool ds=ratinmaze(maze,sol,i+1,j,n,m);
sol[i][j]=0;
return ds;