OpenTable search and filter expressions may contain parentheses, square brackets, and braces mixed with ordinary text. Given a string, determine whether every bracket is correctly matched and nested.
Ignore all characters other than (), [], and {}. The empty string and strings containing no brackets are considered balanced.
Implement is_balanced(text), which accepts a string and returns a boolean:
True when every opening bracket has the correct closing bracket in the correct order.False when a closing bracket has no matching opening bracket, bracket types do not match, or any opening brackets remain unmatched.def is_balanced(text):