mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-07 02:05:08 +08:00
Style changed
This commit is contained in:
@ -14,11 +14,12 @@ function main () {
|
|||||||
for (let j = 0; j < i; j++) {
|
for (let j = 0; j < i; j++) {
|
||||||
if (x[i] > x[j]) {
|
if (x[i] > x[j]) {
|
||||||
dp[i] = Math.max(dp[i], 1 + dp[j])
|
dp[i] = Math.max(dp[i], 1 + dp[j])
|
||||||
if (dp[i] > res)
|
if (dp[i] > res) {
|
||||||
res = dp[i]
|
res = dp[i]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
console.log('Length of Longest Increasing Subsequence is:', res)
|
console.log('Length of Longest Increasing Subsequence is:', res)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user