~/boss / bracket-seal

Stack (bracket matching)

The Seal

Read the seal one bracket at a time. Does it hold, or does it break?

Loading the fight…

How to beat it

Every opening bracket goes on top of the stack. A closer must match the one on top: match, pop it. Wrong type, or nothing on the stack? The seal breaks. At the end the stack must be empty: anything left was never closed.

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

More bosses

esc