Number of Islands

Graphs ยท medium

Given a grid of `1` (land) and `0` (water), implement `numIslands(grid)` returning the number of islands. Islands connect horizontally or vertically.

Learning resources

Loading...

Run your code to see results.