【栈】括号匹配2
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目描述
给出包含“()”和“[]”的括号序列,判断是否合法。
输入格式
第一行一个整数n表示有n个字符串 接下来n行,每行一个字符串s
输出格式
如果合法输出Yes,否则输出No
样例 #1
样例输入 #1
3
([])
(([()])))
([()[]()])()
样例输出 #1
Yes
No
Yes
提示
只考虑是否匹配,不需要考虑括号的优先级