Python quadratic complexity


#1
def countAndSay(self, A):
    if A==1:
        return '1'
    st='1'
    for i in range(A-1):
        j=0
        check=st[0]
        sst=''
        count=0
        while j<len(st):
            if st[j]==check:
                count+=1
            else:
                sst=sst+str(count)+check
                check=st[j]
                j=j-1
                count=0
            j=j+1
        sst=sst+str(count)+check
        st=sst
    return st