What is the Complexity?


#1
public class Solution {
    public String countAndSay(int A) {
        if (A <= 2) return "11".substring(0, A);
        String s = countAndSay(A - 1);
        StringBuilder sb = new StringBuilder("");
        int cnt = 1;
        char c = s.charAt(0);
        for (int i = 1; i < s.length(); ++i) {
            if (s.charAt(i) == s.charAt(i - 1))
                ++cnt;
            else {
                sb.append(cnt);
                sb.append(c);
                cnt = 1;
                c = s.charAt(i);
            }
        }
        sb.append(cnt);
        sb.append(c);
        return sb.toString();
    }
}