Balanced Brackets
100 points · 0 solved
The first line is T. Each of the next T lines contains only the characters ()[]{}. Print YES if the brackets are balanced and properly nested, otherwise NO.
Example 1 input
3
()[]{}
([)]
{[()]}
Expected output
YES NO YES
main.py
Ctrl+Enter runs · Ctrl+Shift+Enter submits