Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 481 Bytes

084.md

File metadata and controls

16 lines (11 loc) · 481 Bytes

Daily Coding Problem: Problem #84 [Medium]

Good morning! Here's your coding interview problem for today.

This problem was asked by Amazon.

Given a matrix of 1s and 0s, return the number of "islands" in the matrix. A 1 represents land and 0 represents water, so an island is a group of 1s that are neighboring whose perimeter is surrounded by water.

For example, this matrix has 4 islands.

1 0 0 0 0
0 0 1 1 0
0 1 1 0 0
0 0 0 0 0
1 1 0 0 1
1 1 0 0 1