@@ -0,0 +1,1803 @@
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0Apublic class LeetCode0301 %7B%0A    public List%3CString%3E removeInvalidParentheses(String s)%0A    %7B%0A        List%3CString%3E result = new ArrayList%3CString%3E();%0A%0A        if (s == null %7C%7C s.length() == 0) %7B%0A            result.add(%22%22);%0A            return result;%0A        %7D%0A        int%5B%5D minStep = new int%5B%5D %7B Integer.MAX_VALUE %7D;%0A        DFS(s, %22%22, 0, 0, 0, minStep, result);%0A        if (result.size() == 0) %7B%0A            result.add(%22%22);%0A        %7D%0A        return result;%0A    %7D%0A%0A    private void DFS(String s, String current, int index, int stepCount,%0A        int leftCount, int%5B%5D minStep, List%3CString%3E result)%0A    %7B%0A%0A        if (current.length() != 0 && leftCount %3C 0) %7B%0A            return;%0A        %7D%0A%0A        if (index %3C s.length()) %7B%0A            char c = s.charAt(index);%0A            if (c != '(' && c != ')') %7B%0A                current += c;%0A                index += 1;%0A            %7D%0A        %7D%0A%0A        if (index == s.length()) %7B%0A            if (leftCount != 0) %7B%0A                return;%0A            %7D%0A            if (stepCount %3C minStep%5B0%5D) %7B%0A                result.clear();%0A                result.add(current);%0A                minStep%5B0%5D = stepCount;%0A            %7D else if (stepCount == minStep%5B0%5D && !result.contains(current)) %7B%0A                result.add(current);%0A            %7D%0A            return;%0A        %7D%0A%0A        char c = s.charAt(index);%0A%0A        DFS(s, current + c, index + 1, stepCount, c == '(' ? leftCount + 1 %0A            : c == ')' ? leftCount - 1 : leftCount, minStep, result);%0A        DFS(s, current, index + 1, stepCount + 1, leftCount, minStep, result);%0A    %7D%0A%0A    public static void main(String%5B%5D args)%0A    %7B%0A        LeetCode0301 leetcode = new LeetCode0301();%0A        System.out.println(leetcode.removeInvalidParentheses(%22()())()%22));%0A    %7D%0A%7D%0A

Add LeetCode0301.java