@@ -0,0 +1,1125 @@
+package rol;%0A%0A%0Aclass Solution %7B%0A%0A    public String reverseOnlyLetters(String S) %7B%0A%0A        char%5B%5D chars = S.toCharArray();%0A        int len = S.length();%0A%0A        int i = 0;%0A        int j = len - 1;%0A%0A        while (i %3C j) %7B%0A%0A            // %E5%8F%8D%E8%BD%AC%E5%AD%97%E6%AF%8D, %E4%BD%86%E8%A6%81%E4%BF%9D%E8%AF%81%E9%9D%9E%E5%AD%97%E6%AF%8D%E4%BD%8D%E7%BD%AE%E4%B8%8D%E5%8F%98%0A            while (i %3C j && !isCharacter(chars%5Bi%5D)) %7B%0A                i++;%0A            %7D%0A            while (i %3C j && !isCharacter(chars%5Bj%5D)) %7B%0A                j--;%0A            %7D%0A%0A            if(i %3E j) %7B%0A                break;%0A            %7D%0A%0A            char c = chars%5Bi%5D;%0A            chars%5Bi%5D = chars%5Bj%5D;%0A            chars%5Bj%5D = c;%0A            i++;%0A            j--;%0A        %7D%0A%0A        return String.valueOf(chars);%0A    %7D%0A%0A    private boolean isCharacter(char c) %7B%0A        // A- Z: 65 - 90%0A        // a-z: 97 - 122%0A        return ((c %3E= 65 && c %3C= 90) %7C%7C (c %3E= 97 && c %3C= 122));%0A    %7D%0A%7D%0A%0A/**%0A * Answer%0A */%0Apublic class Answer %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Solution sol = new Solution();%0A%0A        String x = %22a-bC-dEf-ghIj%22;%0A        System.out.println(x);%0A        String str = sol.reverseOnlyLetters(x);%0A        System.out.println(str);%0A    %7D%0A%7D%0A

add `rever only letters` solution