why is it failing test case 2.
Also, where is the mistake as it is not printing “NO PATH FOUND” in this case…
5 4
OXOO
OOOO
XOOO
XOOO
XXXX
why is it failing test case 2.
Also, where is the mistake as it is not printing “NO PATH FOUND” in this case…
5 4
OXOO
OOOO
XOOO
XOOO
XXXX
@Karanveer your code is correct and only fails when maze[n-1][m-1]==X so check this case separately
dont forget to hit like and mark resolved if cleared 
It is still printing the wrong path, and then saying NO PATH FOUND…
5 4
OXOO
OOOO
XOOO
XOXX
XXXO
In this case it is printing nothing…
5 4 OXOO OOOO XOOO XOXX XXXO In this case it is printing nothing…
@Karanveer ok so just take a check var to store whether ans exist or not and check the two if above commented the changes