You are viewing a single comment's thread. Return to all comments →
elaborated version: def repeatedString(s, n): k = s.count('a') p = n%len(s) ss=s[:p] return k * int(n/len(s)) + ss.count('a')
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 →
elaborated version: def repeatedString(s, n): k = s.count('a') p = n%len(s) ss=s[:p] return k * int(n/len(s)) + ss.count('a')