~/boss / island-count
Flood fill (DFS or BFS on a grid)
The Burning Isles
How many islands? Scan the map, set each new one on fire, and count it once.
Loading the fight…
How to beat it
Scan row by row. Land you haven't burned? That's a new island: count it and set it on fire. Fire spreads up, down, left and right (never diagonally) until the whole island is burned. Keep scanning: burned land is skipped, so nothing is counted twice.
Now the real boss
Interviews ask for the code. Watch it run, then write it yourself, tested in Python, C++ or Java.
On your phone? Writing code is easier on a laptop: open bossfight.dev/problems/number-of-islands there. Sign in with your email to keep your progress on every device.