You are viewing a single comment's thread. Return to all comments →
def repeatedString(s, n): l = len(s) if l == 1: return n t = n//l a_cnt = s.count('a') * t + s[:n%l].count('a') return a_cnt
why I am getting two cases not passed?
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 →
def repeatedString(s, n): l = len(s) if l == 1: return n t = n//l a_cnt = s.count('a') * t + s[:n%l].count('a') return a_cnt