~/boss / two-potions

Two sum with a hash map

The Potion Shelf

Find the two potions that make 100. One walk down the shelf.

Loading the fight…

How to beat it

Carry a notebook of potions you've seen. For each potion, look up its partner: 100 minus it. In the notebook? That's the pair. Not there? Write this potion down and walk on.

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

More bosses

esc