• + 0 comments

    A one line implementation in Python 3:

    def repeatedString(s, n):
        return s.count("a")*(n//len(s)) + s[:n%len(s)].count("a")