@@ -0,0 +1,1242 @@
+package leetcode;%0A%0Aimport java.util.Stack;%0A%0A/**%0A * https://oj.leetcode.com/problems/valid-parentheses/%0A */%0Apublic class Problem20 %7B%0A    public boolean isValid(String s) %7B%0A        char%5B%5D chars = s.toCharArray();%0A        Stack%3CCharacter%3E stack = new Stack%3C%3E();%0A        for (char c : chars) %7B%0A            if (c == '%7D') %7B%0A                if (stack.isEmpty()) %7B%0A                    return false;%0A                %7D%0A                char openChar = stack.pop();%0A                if (openChar != '%7B') %7B%0A                    return false;%0A                %7D%0A            %7D else if (c == '%5D') %7B%0A                if (stack.isEmpty()) %7B%0A                    return false;%0A                %7D%0A                char openChar = stack.pop();%0A                if (openChar != '%5B') %7B%0A                    return false;%0A                %7D%0A            %7D else if (c == ')') %7B%0A                if (stack.isEmpty()) %7B%0A                    return false;%0A                %7D%0A                char openChar = stack.pop();%0A                if (openChar != '(') %7B%0A                    return false;%0A                %7D%0A            %7D else %7B%0A                stack.push(c);%0A            %7D%0A        %7D%0A        if (!stack.isEmpty()) %7B%0A            return false;%0A        %7D%0A        return true;%0A    %7D%0A%7D%0A

Solve problem 20