Longest increasing subsequence
This is the list of random numbers: [1, 9, 5, 13, 3, 11, 7, 15, 2, 10, 6, 14, 4, 12, 8, 16]
Remove items from the list in such a way that the rest items were sorted ascending and the list was as long as possible.
The solution for the above array is: [1, 3, 7, 10, 12, 16]
The implementation should:
- be a function, take an array and return an array
- not use external modules
- be implemented in node.js
Solution based on Wikipedia.