Rat Chases its cheese problem 2

https://ide.geeksforgeeks.org/KpvLehhiMR----what’s the error in the code two test cases are not passing, i have taken input in string format as u people suggested…

hey @AbhishekAhlawat1102
try for this input
5 7
OXOOOOX
OXOXOXX
OXOXOOX
OOOXOXX
XXOXOOO
correct answer :
1 0 1 1 1 0 0
1 0 1 0 1 0 0
1 0 1 0 1 0 0
1 1 1 0 1 0 0
0 0 0 0 1 1 1
your code gives : NO PATH FOUND

The rat can move from a position towards left, right, up or down on the grid.
you need 4 recursive call
correct code