mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 08:16:50 +08:00
tests: add tests of LongestIncreasingSubsequence
(#1660)
This commit is contained in:
@ -6,6 +6,9 @@
|
||||
// Return the length of the Longest Increasing Subsequence, given array x
|
||||
function longestIncreasingSubsequence(x) {
|
||||
const length = x.length
|
||||
if (length == 0) {
|
||||
return 0
|
||||
}
|
||||
const dp = Array(length).fill(1)
|
||||
|
||||
let res = 1
|
||||
|
Reference in New Issue
Block a user