@@ -0,0 +1,717 @@
+public class Solution %7B%0A    public String countAndSay(int n) %7B%0A        if(n %3C= 0)%7B%0A            return %22%22;%0A        %7D%0A        String cur = %221%22;%0A        for(int i = 1; i %3C n; i++)%7B%0A            cur = getNext(cur);%0A        %7D%0A        return cur;%0A    %7D%0A    private String getNext(String str)%7B%0A        String result = %22%22;%0A        int len = str.length(), num = 1;%0A        char digit = str.charAt(0);%0A        for(int i = 1; i %3C len; i ++)%7B%0A            if(str.charAt(i) != digit)%7B%0A                result = result + num + digit;%0A                digit = str.charAt(i);%0A                num = 1;%0A            %7Delse%7B%0A                num ++;%0A            %7D%0A        %7D%0A        result = result + num + digit;%0A        return result;%0A    %7D%0A%7D

Q38 Count and Say