You are viewing a single comment's thread. Return to all comments →
And why count the same thing twice? :)
s = input() n = int(input()) d, r = divmod(n, len(s)) print(s.count('a', 0, r) * (d + 1) + s.count('a', r) * d)
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 →
And why count the same thing twice? :)