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 8%
TrueBoxGuy
#2
108 c.
Top 15%
helbling
#3
114 c.
Top 23%
Natanaelel
#4
116 c.
Top 31%
tree
#5
122 c.
Top 38%
Shanethegamer
#6
129 c.
Top 46%
voytxt
#7
163 c.
Top 62%
Thomasdcrt
team
#8
174 c.
Top 69%
SephQ
#9
196 c.
Top 77%
maximec-indy
#10
218 c.
Top 85%
scpchicken
#11
255 c.
Top 92%
endevo-mschulz
#12
293 c.
Top 100%
ComputerKWasTaken