Island Counter

Count the number of 1s islands in a matrix of 0s and 1s.

Medium1/5/2024

Problem statement

Given a matrix of 0s and 1s, count the number of 1s islands. An island is a group of 1s that are connected horizontally and vertically, but not diagonally.

Problem leaderboard

#
Size
%
Users
#1
112 c.
Top 8%
helbling
#2
114 c.
Top 17%
Natanaelel
#3
116 c.
Top 25%
tree
#4
122 c.
Top 33%
Shanethegamer
#5
129 c.
Top 42%
voytxt
#6
163 c.
Top 58%
team
Thomasdcrt
#7
174 c.
Top 67%
SephQ
#8
196 c.
Top 75%
maximec-indy
#9
218 c.
Top 83%
scpchicken
#10
255 c.
Top 92%
endevo-mschulz
#11
293 c.
Top 100%
ComputerKWasTaken