Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
one for solution in Clear category for [old] Long Repeat by kirillsidorov
"use strict";
function longRepeat(line) {
let length = 1;
let maxlength = 0;
for(let i = 1; i < line.length; i++){
length = line[i] === line[i-1] ? length + 1 : 1;
maxlength = Math.max(maxlength, length);
}
return maxlength;
}
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"?');
}
Feb. 1, 2020