You are viewing a single comment's thread. Return to all comments →
My code does exactly the same but here's more readable:
def repeatedString(s, n): length = len(s) div = math.floor(n/length) extra = n%length norm = s.count("a") total = norm*div splice = s[:extra] total += splice.count("a") return total
Seems like cookies are disabled on this browser, please enable them to open this website
Repeated String
You are viewing a single comment's thread. Return to all comments →
My code does exactly the same but here's more readable: