You are viewing a single comment's thread. Return to all comments →
Python solution
def repeatedString(s, n): a_count = 0 for c in s: if c=="a": a_count+=1 repeated = a_count*(n//len(s)) mod = n%len(s) for c in s[:mod]: if c=="a": repeated+=1 return repeated
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 →
Python solution