You are viewing a single comment's thread. Return to all comments →
l = len(s) print(s.count("a") * (n // l + s.count("a", 0, n%l))
is better in terms of performance due to it do not use slice.
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 →
is better in terms of performance due to it do not use slice.