01 · Question
Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.
Example:
- Input:
grid = [["1","1","0"],["1","0","0"],["0","0","1"]] - Output:
2
01 · Question
Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.
Example:
grid = [["1","1","0"],["1","0","0"],["0","0","1"]]2