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
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Early May, 2026
Senior
Hello Interview Premium
Your account is free and you can post anonymously if you choose.