diff --git a/src/algorithms/sets/longest-increasing-subsequence/dpLongestIncreasingSubsequence.js b/src/algorithms/sets/longest-increasing-subsequence/dpLongestIncreasingSubsequence.js index dcb06149..c7a60be8 100644 --- a/src/algorithms/sets/longest-increasing-subsequence/dpLongestIncreasingSubsequence.js +++ b/src/algorithms/sets/longest-increasing-subsequence/dpLongestIncreasingSubsequence.js @@ -55,7 +55,7 @@ export default function dpLongestIncreasingSubsequence(sequence) { while (rightIndex > -1) { const leftIndex = lengthsArray.findLastIndex((item, idx) => ( - item === lengthsArray[rightIndex] - 1 && idx < rightIndex + item === lengthsArray[rightIndex] - 1 && idx < rightIndex )); longestIncreasingSubsequence.unshift(sequence[rightIndex]);