grid
of 0's and 1's, an island is a group of1
's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.6
. Note the answer is not 11, because the island must be connected 4-directionally.0
.grid
does not exceed 50.