Bug Report for https://neetcode.io/problems/matrixBFS
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
The problem does not test whether or not the initial top, leftmost location is a 1. In this case, you would need to return -1.
I made the following test case, and the solution code provided output a 6 rather than -1:
grid=[[1, 0, 0, 0],[0, 0, 0, 0],[0, 1, 0, 1],[0, 1, 0, 0]]
The only change that needs to be made to the code is adding a conditional that checks that the starting location is not blocked before adding (0,0) to the queue and the set.

Bug Report for https://neetcode.io/problems/matrixBFS
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
The problem does not test whether or not the initial top, leftmost location is a 1. In this case, you would need to return -1.
I made the following test case, and the solution code provided output a 6 rather than -1:
grid=[[1, 0, 0, 0],[0, 0, 0, 0],[0, 1, 0, 1],[0, 1, 0, 0]]
The only change that needs to be made to the code is adding a conditional that checks that the starting location is not blocked before adding (0,0) to the queue and the set.