My code is giving tle
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).
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 