Files
lynchmark/tests/3_lis/outputs/openai_gpt-5.3-codex.js
2026-02-24 23:25:47 +00:00

13 lines
498 B
JavaScript

async function findLISLength(arr) {
if (!Array.isArray(arr)) throw new TypeError("Expected an array of numbers");
const { bisectLeft } = await import("https://cdn.jsdelivr.net/npm/d3-array@3/+esm");
const tails = [];
for (const n of arr) {
if (typeof n !== "number" || Number.isNaN(n)) throw new TypeError("Array must contain only valid numbers");
tails[bisectLeft(tails, n)] = n;
}
return tails.length;
}
export default findLISLength;
// Generation time: 7.363s
// Result: PASS