This commit is contained in:
xxgjzftd 2025-05-05 20:41:48 +00:00 committed by GitHub
commit f8babbb491
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 6 deletions

View File

@ -2519,7 +2519,7 @@ export function traverseStaticChildren(
// https://en.wikipedia.org/wiki/Longest_increasing_subsequence
function getSequence(arr: number[]): number[] {
const p = arr.slice()
const result = [0]
const result = []
let i, j, u, v, c
const len = arr.length
for (i = 0; i < len; i++) {
@ -2541,12 +2541,10 @@ function getSequence(arr: number[]): number[] {
v = c
}
}
if (arrI < arr[result[u]]) {
if (u > 0) {
p[i] = result[u - 1]
}
result[u] = i
if (u > 0) {
p[i] = result[u - 1]
}
result[u] = i
}
}
u = result.length