Your question is Open and Closed Brackets Checker. 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.
HCLTech automation tooling may need to validate configuration expressions before processing them. Given a string containing parentheses, square brackets, curly braces, and other characters, determine whether every bracket is correctly matched and nested.
A bracket sequence is valid when each closing bracket matches the most recently opened unmatched bracket. Non-bracket characters must be ignored. Return True for a valid sequence and False otherwise.
Implement is_valid_brackets(s), where s is a string. Return a boolean indicating whether all brackets in s are balanced and properly ordered. The supported bracket pairs are (), [], and {}.
def is_valid_brackets(s):