sir test case 1 and 2 fail why
Rat chases its chese
it is also possible to go up and down you are not considering it. you need to make an additional visited array in this case to check if the cell has been visited before or not
code for reference purpose