@@ -0,0 +1,1788 @@
+import java.util.*;%0Aclass Solution%7B%0A   %0A   public static void main(String %5B%5Dargh)%0A   %7B%0A      Scanner sc = new Scanner(System.in);%0A      %0A      while (sc.hasNext()) %7B%0A         String input=sc.next();%0A         char%5B%5D str = input.toCharArray();%0A         Deque%3CCharacter%3E stack = new ArrayDeque%3CCharacter%3E();%0A         boolean matched = true;%0A         for (int i = 0; i %3C str.length; i++) %7B%0A            switch(str%5Bi%5D) %7B%0A                case '(':%0A                case '%5B':%0A                case '%7B':%0A                    stack.push(str%5Bi%5D);%0A                    break;%0A                case ')':%0A                    if (stack.isEmpty() %7C%7C stack.pop() != '(') %7B%0A                      matched = false;  %0A                    %7D%0A                    break;%0A                case '%5D':%0A                    if (stack.isEmpty() %7C%7C stack.pop() != '%5B' ) %7B%0A                      matched = false;  %0A                    %7D%0A                    break;%0A                case '%7D':%0A                    if (stack.isEmpty() %7C%7C stack.pop() != '%7B') %7B%0A                      matched = false;  %0A                    %7D%0A                    break;%0A                default:%0A                    break;%0A            %7D%0A            %0A            if (!matched) %7B%0A                System.out.println(%22false%22);  %0A                break;%0A            %7D%0A            %0A         %7D%0A         if (!matched) %7B%0A             continue;%0A         %7D %0A          %0A         if (stack.isEmpty()) %7B%0A            System.out.println(%22true%22); %0A         %7D else %7B%0A            System.out.println(%22false%22);  %0A         %7D%0A      %0A      %7D%0A      %0A   %7D%0A%7D%0A%0A// Use ArrayDeque instead of Stack. (A more complete and consistent set of LIFO stack operations is provided by the Deque interface and its implementations)%0A// fail to match, break the character iteration loop immedietaly. 

add java_stack