Shortest Path on a Grid with Gas Stations (State Reset)
You are given an m x n grid grid where:
Sis the startTis the target#is a wall (blocked).is an empty cellGis a gas station
You start at S. You may move one cell at ...
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:
