You are viewing a single comment's thread. Return to all 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
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 →
Shortes Python Solution without the use of loops and I would like to share this credit with victor_escoto