You are viewing a single comment's thread. Return to all comments →
I did the same but with regex:
function repeatedString(s, n) { const count = (s) => s.replace(/[^a]/g, '').length; return count(s) * (parseInt(n / s.length)) + count(s.substr(0, n % s.length)); }
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 →
I did the same but with regex: