in the test case given in the question,multiple solutions exists,but only one is printed.what is logic with which i need the choose a specific solution
Cannot understand the requirement fo the output
Hi @anishmondal81618161, pls read the question once again carefully. It says:
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).
Hence, only 1 possible solution will exist we restrict to this constraint.
Hope this helps 
Okay,thanks.Sorry,I did not read it carefully.