Your question is Validate Bracket Pairing. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Columbia Bank's expression validation utility receives strings containing parentheses, braces, and square brackets. Determine whether every opening bracket has the correct closing bracket in the correct order.
Implement is_balanced(expression) and return True when the expression is balanced, or False otherwise. An empty expression is considered balanced. The input contains only the six bracket characters: (, ), {, }, [, and ].
expression containing zero or more bracket characters.def is_balanced(expression):