KB
Size: a a a
KB
KB
KB
KB
L
function isPangram(str) {прогоняй тесты
if (str.length < 26) return false
let known = 0
for (let i = 0; i < str.length; i++) {
const char = str.charCodeAt(i)
const delta = char >= 97 && char < 123 ? 97 : 65
const n = char - delta
if (n >= 0 && n < 26) {
const shift = 1 << n;
known |= shift
if (known === 67108863) {
return true
}
}
}
return false
}
const u8vec = new Uint8Array(26)
function isPangram(str) {
u8vec.fill(0)
for(let i = 0; i < str.length; i++) {
let ord = str.charCodeAt(i)
ord -= ( ord >= 97 ) ? 97 : 65
if ( ord < 0 || ord > 25 )
continue
u8vec[ord] = 1
}
return u8vec.every(Boolean)
}
L
С
L
L
KB
KB
KB
DE
KB
const u8vec = new Uint8Array(26)
function isPangram(str) {
u8vec.fill(0)
for(let i = 0; i < str.length; i++) {
let ord = str.charCodeAt(i)
ord -= ( ord >= 97 ) ? 97 : 65
if ( ord < 0 || ord > 25 )
continue
u8vec[ord] = 1
}
return u8vec.every(Boolean)
}