You are viewing a single comment's thread. Return to all comments →
if len(s) == 1: return n if s == 'a' else 0 elif 'a' not in s: return 0 else: a_in_s = s.count('a') repe = n//len(s) remain = n % len(s) return a_in_s * repe + s[:remain].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 →