[LeetCode]Valid Parentheses

来源:互联网 发布:西西软件下载网站 编辑:程序博客网 时间:2024/06/16 12:55

Given a string containing just the characters '('')''{''}''[' and ']', determine if the input string is valid.

The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]" and "([)]" are not.

写第一遍的时候脑子犯二 还给写成了if(s[i] == paren.top())balabala报错了还瞪了好久心想没错啊。。。


0 0
原创粉丝点击