Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for [old] Long Repeat by kurosawa4434
"use strict";
function longRepeat(line) {
return line.length
&& Math.max.apply(null, line.match(/(.)(\1*)/g).map(x=>x.length));
}
var assert = require('assert');
if (!global.is_checking) {
assert.equal(longRepeat('sdsffffse'), 4, "First")
assert.equal(longRepeat('ddvvrwwwrggg'), 3, "Second")
console.log('"Run" is good. How is "Check"?');
}
Aug. 19, 2017
Comments: