Skip to content

Latest commit

 

History

History

shortest-path-in-a-hidden-grid

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

< Previous                  Next >

Related Topics

[Depth-First Search] [Breadth-First Search] [Graph] [Interactive]

Similar Questions

  1. Robot Room Cleaner (Hard)
  2. Minimum Path Cost in a Hidden Grid (Medium)

Hints

Hint 1 The grid is at a maximum 500 x 500, so it is clever to assume that the robot's initial cell is grid[501][501]
Hint 2 Run a DFS from the robot's position to make sure that you can reach the target, otherwise you should return -1.
Hint 3 Now that you are sure you can reach the target, run BFS to find the shortest path.