Rat in a maze Test#1

Test case #1 getting wrong answer. Please check.

Hello @zenolusx2,

Your code is not considering the testcases like:
5 4
OXOO
OOOX
OOXO
XOOO
XXOX
Your Output:
1 0 0 0
1 1 0 0
0 1 0 0
0 1 1 1
0 0 0 1
Expected Output:
-1

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

@S18ML0016 Fixed it (https://ide.codingblocks.com/s/112120) but still the same issue

I modified your code:

Now, it is passing all the testcases.

It was earlier giving wrong output for the testcase with 1000 rows and 1000 columns

Hope, this would help.
Give a like, if your problem is solved.