pls, point out mistakes. it is showing run error for two test cases
Rat chases its cheese
@Keshav99 when you are printing the solution check inside your for loops you have mixed w,i,j and q while writing for loop.
and make your last box out[row-1][col-1]=1 before printing.
and return false if out[i][j]==1, means that is already visited.
its still showing TLE error for case 1,3,4
@Keshav99 i told you you had mixed all w,i and q,j but you only updated inner for loop, look at your outer for loop where you have taken w as iterator.
thanks ,all good now
1 Like