Rat in a maze problem


please check my code

it is mentioned in the question that you only have to print the rightmost path, so you should only call down if right == false


I did make the changes and it runs perfectly fine for 2 test cases but failed the rest

there were still couple of mistakes in your code

  1. you need to reach N-1, M-1 not N, M because we are using 0 based indexing
  2. you were comparing i to M and j to N which is opposite
    Corrected Code
    https://ide.codingblocks.com/s/327012