dsa10 min read
Number of Enclaves — Boundary Flood Fill That Trips Up Candidates
LC 1020 Number of Enclaves asks you to count land cells that cannot reach the grid boundary. The trick is to flip the problem: flood-fill from the boundary inward, eliminating all reachable land, then count what remains.
Read →