You are viewing a single comment's thread. Return to all comments →
JS solution :
function repeatedString(s, n) { return ([...s.matchAll(/a/g)].length * Math.floor(n / s.length)) + ([...s.substring(0, (n % s.length)).matchAll(/a/g)].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 →
JS solution :