https://ide.codingblocks.com/s/355338,
please check my code , two test cases are not passing,
Rat Chases its cheese
Hey @CODER_JATIN
Updated ur code and mentioned the changes in comments: https://ide.codingblocks.com/s/353791
This is not a classical rat in a maze problem,re-read the problem statement
If this resolves ur query then please mark it as resolved 
here the rat can move in up and left direction ? what it make changed from classical rat in a maze problem.
O X O O O
O O O X O
X X X X O
In classic problem there is no solution for this
But in this one solution exist for the above example