Number of Islands
Count the groups of connected land in a grid. Why the first land cell you meet starts a new island, and how a BFS flood fill that sinks cells as it queues them counts each island exactly once.
Spotted a mistake in this lesson?Report an issue →