Rat in a maze problem


i dont know wht is wrong with my code

hi @yyashu123

just change condition in line 6
if((i==m-1)&&(j==n-1))

as you have to reach at last cell which is n-1,m-1 not n,m

your code give correct output

i hope this help
if you have more doubts regarding this feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course

i have made the above changes yet most of my cases are showing run time error


how to get rid of the run time error

@yyashu123
see the constraints
1<=N,M<=1000
size of grid can be upto 1000X1000

so change size of array