Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Model the grid as a graph where cells are nodes and edges are between adjacent cells. Edges to cells with obstacles have a cost of 1 and all other edges have a cost of 0.
Could you use 0-1 Breadth-First Search or Dijkstra’s algorithm?