mirror of
https://github.com/lynchmarkHQ/lynchmark.com.git
synced 2026-10-08 21:35:23 +00:00
14 lines
354 B
JavaScript
14 lines
354 B
JavaScript
async function findLISLength(nums) {
|
|
const { bisectLeft } = await import('https://cdn.skypack.dev/d3-array');
|
|
const tails = [];
|
|
|
|
for (const x of nums) {
|
|
const i = bisectLeft(tails, x);
|
|
i === tails.length ? tails.push(x) : (tails[i] = x);
|
|
}
|
|
|
|
return tails.length;
|
|
}
|
|
export default findLISLength;
|
|
// Generation time: 0.903s
|
|
// Result: PASS
|