Skip to content

Bug Report for shortest-path-in-binary-matrix #4309

Open
@sendeb

Description

@sendeb

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions