@@ -0,0 +1,921 @@
+package leetcode.valid_parentheses;%0A%0Apublic class Solution %7B%0A%09public boolean isValid(String s) %7B%0A%09%09StringBuilder sb = new StringBuilder();%0A%09%09for(char c : s.toCharArray())%7B%0A%09%09%09switch(c)%7B%0A%09%09%09case '(':%0A%09%09%09%09sb.append(c);%0A%09%09%09%09break;%0A%09%09%09case '%5B':%0A%09%09%09%09sb.append(c);%0A%09%09%09%09break;%0A%09%09%09case '%7B':%0A%09%09%09%09sb.append(c);%0A%09%09%09%09break;%0A%09%09%09case ')':%0A%09%09%09%09if(sb.length() %3E 0 && sb.charAt(sb.length() - 1) == '(')%7B%0A%09%09%09%09%09sb.setLength(sb.length() - 1);%0A%09%09%09%09%7Delse return false;%0A%09%09%09%09break;%0A%09%09%09case '%5D':%0A%09%09%09%09if(sb.length() %3E 0 && sb.charAt(sb.length() - 1) == '%5B')%7B%0A%09%09%09%09%09sb.setLength(sb.length() - 1);%0A%09%09%09%09%7Delse return false;%0A%09%09%09%09break;%0A%09%09%09case '%7D':%0A%09%09%09%09if(sb.length() %3E 0 && sb.charAt(sb.length() - 1) == '%7B')%7B%0A%09%09%09%09%09sb.setLength(sb.length() - 1);%0A%09%09%09%09%7Delse return false;%0A%09%09%09%09break;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return sb.length() == 0;%0A%09%7D%0A%09%0A%09public static void main(String%5B%5D args)%7B%0A%09%09System.err.println(%22ans: %22 + new Solution().isValid(%22%7B(%5B%5D%5B)%5D()()%5B%5D%5B%5D%5B%5D%7B%7D%7B%7D%7B%7D%7D%22));%0A%09%7D%0A%7D%0A

Add java solution for 20. Valid Parentheses