NeetCode #591LC-1020MediumGraphs
← Back to All Problems#591 · #1020 · Number of Enclaves(飞地的数量)
📌 Problem Statement & Constraints
Given an
m x n binary matrix grid where 0 is sea and 1 is land, return the number of land cells from which you cannot walk off the grid boundary via 4-directional land moves. Constraints: 1 <= m, n <= 500.🔒
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!