mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-02-04 01:47:54 +00:00
13 lines
350 B
JavaScript
13 lines
350 B
JavaScript
const findLISLength = async a => {
|
|
if (!a?.length) return 0
|
|
const { bisectLeft: b } = await import('https://cdn.jsdelivr.net/npm/d3-array@3/+esm')
|
|
const t = []
|
|
for (const x of a) {
|
|
const i = b(t, x)
|
|
i === t.length ? t.push(x) : t[i] = x
|
|
}
|
|
return t.length
|
|
}
|
|
export default findLISLength;
|
|
// Generation time: 34.651s
|
|
// Result: PASS
|