@@ -0,0 +1,2115 @@
+package coding4fun;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.Stack;%0A%0Apublic class Problem56 %7B%0A    private static List%3CString%3E allStrings(String s) %7B%0A        List%3CString%3E strings = new ArrayList%3C%3E();%0A        Stack%3CList%3CString%3E%3E stack = new Stack%3C%3E();%0A        String tmp = %22%22;%0A        List%3CString%3E tmpList = new ArrayList%3C%3E();%0A        for (int i = 0; i %3C s.length(); i++) %7B%0A            if (s.charAt(i) == '(') %7B%0A                List%3CString%3E list = new ArrayList%3C%3E();%0A                list.add(tmp);%0A                stack.add(list);%0A                System.out.println(%22storing: %22 + list);%0A                tmp = %22%22;%0A            %7D else if (s.charAt(i) == '%7C') %7B%0A//                System.out.println(tmp);%0A//                tmp = stack.peek() + tmp;%0A                for (String p : stack.peek()) %7B%0A                    tmpList.add(p + tmp);%0A                %7D%0A                System.out.println(%22getting: %22 + tmpList);%0A                tmp = %22%22;%0A            %7D else if (s.charAt(i) == ')') %7B%0A                for (String p : stack.pop()) %7B%0A%0A                %7D%0A//                System.out.println(tmp);%0A                tmp = stack.pop() + tmp;%0A                System.out.println(%22removing: %22 + tmp);%0A//                tmp = %22%22;%0A            %7D else %7B%0A                tmp += s.charAt(i);%0A            %7D%0A        %7D%0A        return strings;%0A    %7D%0A%0A    private static List%3CString%3E allStrings(String s, IntRef ref) %7B%0A        List%3CString%3E strings = new ArrayList%3C%3E();%0A        String tmp = %22%22;%0A        while (ref.val %3C s.length()) %7B%0A            int i = ref.val;%0A            if (s.charAt(i) == '(') %7B%0A                ref.val++;%0A                allStrings(s, ref);%0A            %7D else if (s.charAt(i) == '%7C') %7B%0A%0A            %7D else if (s.charAt(i) == ')') %7B%0A%0A                return strings;%0A            %7D else %7B%0A                tmp += s.charAt(i);%0A                ref.val++;%0A            %7D%0A        %7D%0A        return strings;%0A    %7D%0A%0A    private static class IntRef %7B%0A        private int val;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        System.out.println(allStrings(%22abc(de%7Cfh%7Cg(h%7Ci))j(k%7Cl)%22));%0A    %7D%0A%7D%0A

Add problem 56