Open
Description
Bug Report for https://neetcode.io/problems/shortest-path-in-binary-matrix
I believe the answer for test case grid=[[0,0,0],[1,1,0],[1,1,0]] should be 5 but when I submit my solution, it says it should be 4.
BFS Walkthrough:
Start at (0, 0) with distance = 1
From (0, 0) → Can go to (0, 1) and (1, 2)
From (0, 1) → Can go to (0, 2)
From (0, 2) → Can go to (1, 2)
From (1, 2) → Can go to (2, 2)
From (2, 2) → Reached the destination!
Therefore the shortest path is (0,0) → (0,1) → (0,2) → (1,2) → (2,2) with length 5
Metadata
Metadata
Assignees
Labels
No labels