• + 0 comments

    Shortes Python Solution without the use of loops and I would like to share this credit with victor_escoto

    def repeatedString(s, n):
        if len(s) == 1 and s == 'a':
            return n
        c = s.count('a')
        c *= n//len(s)
        c += s[:n%len(s)].count('a')
        return c