~/boss / two-knights

Two pointers

Two Knights, One Bridge

One knight at each end of a sorted bridge. Find the pair with zero wasted steps.

Loading the fight…

How to beat it

Add the two knights' stones. Too small? Only the left knight stepping right makes it bigger. Too big? The right knight steps left. Every step throws away a whole row of pairs that could never work.

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/two-sum-ii-sorted there. Sign in with your email to keep your progress on every device.

More bosses

esc