Rat in a maze problem

why 2 test case are failing(one wrong answer and other is of tle)

Hello @vipin.kumar,

TLE is due the number of recursive calls is exceeding the time limit.

Try to reduce the number of iterations.