@@ -0,0 +1,1224 @@
+package me.wayne.leetcodetop100.string;%0A%0Aimport java.util.Stack;%0A%0A/**%0A * %E7%BB%99%E5%AE%9A%E4%B8%80%E4%B8%AA%E5%8F%AA%E5%8C%85%E6%8B%AC '('%EF%BC%8C')'%EF%BC%8C'%7B'%EF%BC%8C'%7D'%EF%BC%8C'%5B'%EF%BC%8C'%5D'%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2 s %EF%BC%8C%E5%88%A4%E6%96%AD%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%98%AF%E5%90%A6%E6%9C%89%E6%95%88%E3%80%82%0A * %3Cp%3E%0A * %E6%9C%89%E6%95%88%E5%AD%97%E7%AC%A6%E4%B8%B2%E9%9C%80%E6%BB%A1%E8%B6%B3%EF%BC%9A%0A * %3Cp%3E%0A * %E5%B7%A6%E6%8B%AC%E5%8F%B7%E5%BF%85%E9%A1%BB%E7%94%A8%E7%9B%B8%E5%90%8C%E7%B1%BB%E5%9E%8B%E7%9A%84%E5%8F%B3%E6%8B%AC%E5%8F%B7%E9%97%AD%E5%90%88%E3%80%82%0A * %E5%B7%A6%E6%8B%AC%E5%8F%B7%E5%BF%85%E9%A1%BB%E4%BB%A5%E6%AD%A3%E7%A1%AE%E7%9A%84%E9%A1%BA%E5%BA%8F%E9%97%AD%E5%90%88%E3%80%82%0A * %3Cp%3E%0A * %E9%93%BE%E6%8E%A5%EF%BC%9Ahttps://leetcode-cn.com/problems/valid-parentheses%0A */%0Apublic class LC20_IsValid %7B%0A%0A    public boolean isValid(String s) %7B%0A        Stack%3CCharacter%3E stack = new Stack%3C%3E();%0A        for (int i = 0; i %3C s.length(); i++) %7B%0A            Character ch = s.charAt(i);%0A            if (stack.isEmpty()) %7B%0A                stack.push(ch);%0A            %7D else %7B%0A                Character top = stack.peek();%0A                boolean match = isMatch(top, ch);%0A                if (match) %7B%0A                    stack.pop();%0A                %7D else %7B%0A                    stack.push(ch);%0A                %7D%0A            %7D%0A        %7D%0A        return stack.isEmpty();%0A    %7D%0A%0A    private boolean isMatch(Character one, Character another) %7B%0A        if (one.equals('(') && another.equals(')')) %7B%0A            return true;%0A        %7D else if (one.equals('%7B') && another.equals('%7D')) %7B%0A            return true;%0A        %7D else if (one.equals('%5B') && another.equals('%5D')) %7B%0A            return true;%0A        %7D else %7B%0A            return false;%0A        %7D%0A    %7D%0A%7D%0A

add LC20_IsValid