Skip to main content
Admissions guidance, study banks, and career tools โ€” get started on Shalyam

Number of Islands

Medium Graphs

Given an R x C grid of '1' (land) and '0' (water), count the islands. An island is a group of horizontally or vertically connected land cells.

Constraints

1 <= R, C <= 300

Discussion

No discussions yet.

Rewards ยท v2.1

Join Shalyam Newsletter

Get exclusive insights with every issue: education, research and innovation news.

One email a week. Unsubscribe any time.