【Leetcode】20.有效的括号(Valid Parenthese)
Leetcode - 20 Valid Parenthese (Easy)
题目描述:给定字符串,判断括号是否有效。
Input: "()[]{}"
Output: true
public boolean isValid(String s) {
Stack<Character> stack = new Stack<>();
for (Character c...
原创
2019-06-04 22:16:07 ·
125 阅读 ·
0 评论