Reachability in a Grid Without Turning
Given an R × C grid:
0is a walkable cell;Xis an obstacle;Sis the starting cell;Dis the destination cell.
You may take the first step from S in any of the four cardinal...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
