Cant pass all testcases

Hello @aryanv,

  1. Your code is not considering the case when there is no path:
    5 4
    OXOO
    XOOX
    OOXO
    XOOO
    XXOO
    Expected Output:
    -1
    Your Output:
    No_Output

  2. The size of your matrix

I have modified your code:

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

1 Like