• + 0 comments

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