DEV Community

loading...

Discussion on: Amazon's Interview Question: Count Island

Collapse
v4r15 profile image
v4r15

Umm, call me dumb, but according to the definition you have provided, there is only one island - centered at the second row fourth column.
The solution rather says an island is an isolated one, or a group of adjacent ones, diagonals excluded; that would give six as a result indeed.