DEV Community

I Want To Learn Programming
I Want To Learn Programming

Posted on • Edited on

Code Challenge of the Day: Number of islands (hard)

Count groups of connected 1s (4-directionally) in a 2D grid of 0/1.
Write num_islands(grid).

Starter:

def num_islands(grid):
    # TODO
    pass
Enter fullscreen mode Exit fullscreen mode

Solve it interactively in your browser (no setup), check your answer instantly, and keep your daily streak going on IWTLP: https://iwtlp.com/challenge

Top comments (0)