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]
Lake/Island count and sizes
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]