@@ -0,0 +1,898 @@
+package leetcode;%0A%0A/**%0A * https://oj.leetcode.com/problems/count-and-say/%0A */%0Apublic class Problem38 %7B%0A    public String countAndSay(int n) %7B%0A        String str = %221%22;%0A        if (n == 1) %7B%0A            return str;%0A        %7D%0A        for (int i = 1; i %3C n; i++) %7B%0A            str = countAndSay(str);%0A        %7D%0A        return str;%0A    %7D%0A    %0A    private String countAndSay(String str) %7B%0A        char c = str.charAt(0);%0A        StringBuilder newString = new StringBuilder();%0A        int count = 0;%0A        for (int i = 0; i %3C str.length(); i++) %7B%0A            if (str.charAt(i) != c) %7B%0A                newString.append(count);%0A                newString.append(c);%0A                c = str.charAt(i);%0A                count = 1;%0A            %7D else %7B%0A                count++;%0A            %7D%0A        %7D%0A        newString.append(count);%0A        newString.append(c);%0A        return newString.toString();%0A    %7D%0A%7D%0A

Solve problem 38