НС
Size: a a a
НС
НС
НС
НС
НС
Fast: len=6, count=1000000: 3.635ms
Slow: len=6, count=1000000: 412.262ms
Fast: len=44, count=1000000: 318.167ms
Slow: len=44, count=1000000: 2.130s
Fast: len=26, count=1000000: 207.188ms
Slow: len=26, count=1000000: 1.144s
Fast: len=20000, count=1000: 107.896ms
Slow: len=20000, count=1000: 636.655ms
Fast: len=94720, count=1000: 1.224ms
Slow: len=94720, count=1000: 2.719s
Fast: len=9475248, count=10: 0.034ms
Slow: len=9475248, count=10: 4.118s
НС
Fast: len=6, count=1000000: 3.635ms
Slow: len=6, count=1000000: 412.262ms
Fast: len=44, count=1000000: 318.167ms
Slow: len=44, count=1000000: 2.130s
Fast: len=26, count=1000000: 207.188ms
Slow: len=26, count=1000000: 1.144s
Fast: len=20000, count=1000: 107.896ms
Slow: len=20000, count=1000: 636.655ms
Fast: len=94720, count=1000: 1.224ms
Slow: len=94720, count=1000: 2.719s
Fast: len=9475248, count=10: 0.034ms
Slow: len=9475248, count=10: 4.118s
Fast: len=9475248, count=10: 0.034ms
— для этого тебе надо быть быстрее чем линия в хорошем случаеНС
НС
НС
НС
let obj = {};
let cnt = 0;
for (let i = 0; i < str.length; i++) {
let code = str[i].toLowerCase().charCodeAt(0);
if (code >= 97 and code <= 122 && !obj[code]) {
obj[code] = true;
cnt++;
}
}
return cnt === 26;
НС
С
НС