Calculate total number of islands
Filed under Hexaview
The question
Given a 2-D array where 0 represents water and 1 represents land, calculate the total number of islands formed by 1s surrounded by 0s.
No write-up yet. Related questions below have one.
Related Hexaview questions
Collected from public candidate posts and coding forums. Updated Nov 2026.