Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Uses Spread, Regexp, and Mapping solution in Creative category for [old] Long Repeat by Taylor_Page
"use strict";
function longRepeat(line) {
if (line.length === 0) {
return 0
}
return Math.max(...line.match(/(.)\1*/ig).map( (el) => { return el.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"?');
}
March 19, 2019