Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1020. Number of Enclaves
Count the number of land cells (1s) that belong to connected components that cannot reach the grid boundary. The core challenge is to identify and exclude all land reachable from the boundary (e.g., via BFS/DFS flood-fill) and return the size of the remaining enclosed components; m,n ≤ 500 so an O(mn) solution is expected.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.