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