Search
⌘K

Leetcode 1905. Count Sub Islands

Count how many islands (4-directionally connected 1s) in grid2 are entirely contained within corresponding land cells in grid1 — traverse each island in grid2 (DFS/BFS) and verify every cell is 1 in grid1.

Asked at:

Google

Google


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early May, 2026

Google

Google

Senior

Your account is free and you can post anonymously if you choose.