Your question is Validate Balanced Bracket String. 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.
Given a string s, determine whether it contains a valid set of balanced brackets. The string may contain the characters (), {}, and [], and may also include non-bracket characters that should be ignored. Return True if every opening bracket is closed by the correct type in the correct order; otherwise return False.
def is_balanced_brackets(s):