β back to unit
Challenge
# 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...