Given a string s that may contain bracket characters, determine whether the brackets are properly balanced.
Treat the following as brackets:
(
and
)
[
and
]
{
and
}
All other characters (letters, digits, spaces, punctuation) should be ignored.
A string is balanced if:
s
true
if balanced, otherwise
false
"(a[b]{c})"
→
true
"([)]"
→
false
"(("
→
false
""
→
true
0 ≤ len(s) ≤ 2 * 10^5