Skip to content

gabriel-del/lake_areas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Lake Areas

Receive a matrix as

matrix = [
    [1, 1, 0, 1, 0],
    [1, 0, 1, 0, 0],
    [0, 0, 1, 0, 1],
    [1, 0, 1, 0, 1],
    [1, 0, 1, 1, 0]
]

and count the lakes/islands and return the size of which one on crescent order.

sizes = [1, 2, 2, 3, 5]