~/boss / grid-stairs

Staircase search

The Sorted Vault

Find 42 in 4 steps. Every row and every column is sorted.

Loading the fight…

How to beat it

Start on the top-right corner: the biggest in its row, the smallest in its column. Too big? Everything below it is bigger too, so the whole column is out: step left. Too small? The whole row is out: step down.

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/search-a-2d-matrix-ii there. Sign in with your email to keep your progress on every device.

More bosses

esc