You are viewing a single comment's thread. Return to all comments →
my python3 code easy to understand
def repeatedString(s, n): c = s.count('a') div=n//len(s) if n%len(s)==0: c= c*div else: m = n%len(s) c= c*div+s[:m].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 →
my python3 code easy to understand