gabriel-del / lake_areas

Lake/Island count and sizes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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]

About

Lake/Island count and sizes


Languages

Language:Python 100.0%