However, the implemented algorithm only returns the length of the longest increasing subsequence, not the subsequence itself. This change will create the longestIncreasingSubsequence from the lengthsArray and return that instead of longestIncreasingLength.
The tests have been updated to expect a subsequence instead of length.
The Longest Increasing Subsequence README.md and dpLongestIncreasingSubsequence.test.js give examples of the longest increasing subsequence that will be generated from various sequences:
However, the implemented algorithm only returns the length of the longest increasing subsequence, not the subsequence itself. This change will create the
longestIncreasingSubsequence
from thelengthsArray
and return that instead oflongestIncreasingLength
.The tests have been updated to expect a subsequence instead of length.