NeetCode #581LC-1091MediumGraphs
← Back to All Problems#581 · #1091 · Shortest Path in Binary Matrix(二进制矩阵中的最短路径)
📌 Problem Statement & Constraints
Given an
n x n binary matrix grid, return the length of the shortest clear path from the top-left to the bottom-right, where all cells on the path are 0 and moves are 8-directional. Return -1 if no such path exists. Constraints: 1 <= n <= 100.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!