Find the shortest clear path from top-left to bottom-right in an n x n binary matrix using 8-directional moves.
Constraints
Example
>>> shortest_path_binary_matrix([[0,1],[1,0]]) 2 >>> shortest_path_binary_matrix([[0,0,0],[1,1,0],[1,1,0]]) 4 >>> shortest_path_binary_matrix([[1,0,0],[0,0,0],[0,0,0]]) -1
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints