# stacks advanced

The Deluxe Bracket Inspector

Promotion! Now the code mixes (), [], and {} β€” and a ] can NOT close a (. 🎩

You get a string code of brackets. Print balanced if every bracket closes the matching most-recent opener, otherwise broken.

Example:

Input: code = "{[()]}" Output: balanced

Pushing openers and popping to check the matching type on each closer β€” }, ], ) all correctly close their most recent openers, in order.

πŸ’‘ need a hint?

stk-deluxe-brackets.pyπŸ”’ given lines are locked β€” write your code in between
loading...