Count Islands
Filed under GwynnieBee
The question
Given a 2D matrix where 1s represent connected nodes, count the number of disconnected components (islands).
No write-up yet. Related questions below have one.
Related GwynnieBee questions
Collected from public candidate posts and coding forums. Updated Nov 2026.