Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 294 Bytes

README.md

File metadata and controls

14 lines (9 loc) · 294 Bytes

islands

Given a grid containing elements in the set #{0 1}, count the total number of connected groups of 1s.

For example the grid:

    0 1 0 0 0
    1 0 0 1 0
    0 0 0 0 0
    0 1 0 0 0
    0 1 1 0 0

has 3 groups: #{(1 0) (0 1)}, #{(3 1)}, and #{(1 3) (1 4) (2 4)}