My code is giving tle

code- https://ide.codingblocks.com/s/321028

Hey @anubhavb11
Error is on line 50 ,it should be j++ instead of i++.

still faling some of the test case - https://ide.codingblocks.com/s/321028

For that read the question again

@anubhavb11
Find the rightmost path through which, rat can reach this position. A path is rightmost, if the rat is at position (i,j), it will always move to (i,j+1), if there exists a path from (i,j+1) to (N,M).

still failing 1 test case
code- https://ide.codingblocks.com/s/321028

Hey @anubhavb11
If solution doesn’t exist, just print “-1”.
Also take matrices of size 1001*1001
And please mark it as resolved if your code runs :slightly_smiling_face: