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
104 c.
Top 6%
TrueBoxGuy
#2
108 c.
Top 13%
helbling
#3
114 c.
Top 19%
Natanaelel
#4
116 c.
Top 25%
tree
#5
122 c.
Top 31%
Shanethegamer
#6
125 c.
Top 38%
XenThe
#7
128 c.
Top 44%
Lv0Sys
#8
129 c.
Top 56%
Alex
voytxt
#9
163 c.
Top 69%
Thomasdcrt
team
#10
174 c.
Top 75%
SephQ
#11
196 c.
Top 81%
maximec-indy
#12
218 c.
Top 88%
scpchicken
#13
255 c.
Top 94%
endevo-mschulz
#14
293 c.
Top 100%
ComputerKWasTaken