• + 0 comments
    def repeatedString(s, n):
        a=0
        for i in s:
            if i=="a":
                a+=1
        if n%len(s)==0:
            b=a*(n//len(s))
        else:
            b=a*(n//len(s))
            for i in range(n%len(s)):
                if s[i]=="a":
                    b+=1
        return b