You are viewing a single comment's thread. Return to all comments →
I did it similar:
static long repeatedStringB(String s, long n) { return s.chars().filter(ch -> ch == 'a').count() * (n / s.length()) + s.chars().limit(n % s.length()).filter(ch -> ch == 'a').count(); }
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 it similar: