Skip to content

algorithmseasy

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.

3
()[]{}
([)]
{[()]}
YES
NO
YES
Learn the technique/learn/algorithms-data-structures

main.py