Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
simple way solution in Clear category for [old] Long Repeat by imtiaz.rahi
function longRepeat(line) {
var line = Array.from(line)
var last = "", count = 0, max = 0;
for (var ch of line) {
if (ch == last) {
count++;
if (count > max) max = count;
} else {
count = 1;
last = ch;
}
}
return max > count ? max : count;
}
Sept. 26, 2019