Number of Islands

#200
Medium
Graphs
O(m * n)
O(m * n)
Amazon
Microsoft
Facebook
Google
View on LeetCode

Problem Description

Given an m x n 2D binary grid which represents a map of '1's (land) and '0's (water), return the number of islands.