~/boss / zombie-town

Multi-source BFS

The Outbreak

Every zombie bites at once. Paint each minute's bites, then call the answer.

Loading the fight…

How to beat it

Put every zombie in the queue at the start. Each minute, the queue bites its four neighbors (never diagonally), and the newly bitten join the queue for the next minute. When the queue is empty, the minutes you counted are the answer. Anyone still human? Then it's -1.

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/rotting-oranges there. Sign in with your email to keep your progress on every device.

More bosses

esc