mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-01-14 00:27:55 +00:00
16 lines
310 B
JavaScript
16 lines
310 B
JavaScript
async function findLISLength(nums) {
|
|
if (!nums?.length) {
|
|
return 0;
|
|
}
|
|
|
|
const { bisectLeft } = await import('https://cdn.jsdelivr.net/npm/d3-array@3/+esm');
|
|
|
|
const sub = [];
|
|
|
|
for (const num of nums) {
|
|
sub[bisectLeft(sub, num)] = num;
|
|
}
|
|
|
|
return sub.length;
|
|
}
|
|
export default findLISLength; |