Count the number of 1s islands in a matrix of 0s and 1s.
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.
# | Size | % | Users |
---|---|---|---|
#1 | 104 c. | Top 8% | |
#2 | 108 c. | Top 15% | |
#3 | 114 c. | Top 23% | |
#4 | 116 c. | Top 31% | |
#5 | 122 c. | Top 38% | |
#6 | 129 c. | Top 46% | |
#7 | 163 c. | Top 62% | |
#8 | 174 c. | Top 69% | |
#9 | 196 c. | Top 77% | |
#10 | 218 c. | Top 85% | |
#11 | 255 c. | Top 92% | |
#12 | 293 c. | Top 100% |