Problem with some of the test cases in rat in a maze problem

my code is giving wrong answer for some of the test cases-
link-https://ide.codingblocks.com/s/107678

Hello @rishu7865,

  1. soln[n][m]=1;
    the above statement is failing for the testcases like:
    5 4
    OXOO
    OOOX
    OOXO
    XOOO
    XXOX

Hope, this would help.
Give a like, if you are satisfied.