@@ -0,0 +1,1623 @@
+class Solution %7B%0A    public int compress(char%5B%5D chars) %7B%0A        if (chars == null %7C%7C chars.length == 0) %7B%0A            return 0;%0A        %7D%0A        %0A        if (chars.length == 1) %7B%0A            return 1;%0A        %7D%0A        %0A        int result = 0;%0A        int slow = 0;%0A        int fast = 1;%0A        %0A        while (fast %3C chars.length) %7B%0A            if (chars%5Bfast%5D == chars%5Bslow%5D) %7B%0A                fast ++;%0A            %7D else %7B%0A                if (fast == slow + 1) %7B%0A                    chars%5Bresult%5D = chars%5Bslow%5D;%0A                    result++;%0A                %7D else %7B%0A                    int distance = fast - slow;%0A                    String distanceString = Integer.toString(distance);%0A                    %0A                    chars%5Bresult%5D = chars%5Bslow%5D;%0A                    result ++;%0A                    for (int i = 0; i %3C distanceString.length(); i++) %7B%0A                        chars%5Bresult%5D = distanceString.charAt(i);%0A                        result++;%0A                    %7D%0A                %7D%0A                %0A                slow = fast;%0A                fast ++;%0A            %7D%0A        %7D%0A        %0A        if (slow + 1 == fast) %7B%0A            chars%5Bresult%5D = chars%5Bslow%5D;%0A            result++;%0A        %7D else %7B%0A            int distance = fast - slow;%0A            String distanceString = Integer.toString(distance);%0A                    %0A            chars%5Bresult%5D = chars%5Bslow%5D;%0A            result ++;%0A            for (int i = 0; i %3C distanceString.length(); i++) %7B%0A                chars%5Bresult%5D = distanceString.charAt(i);%0A                result++;%0A            %7D%0A        %7D%0A        %0A        return result;%0A    %7D%0A%7D%0A

Create StringCompression.java