Longest increasing subsequence algorithm finds a subset of numbers from the original sequence in a way that the numbers are always increasing, they are not switched around from their original order and the result is the longest possible outcome.
Wikipedia has this example:
In the first 16 terms of the binary Van der Corput sequence
This subsequence has length six; the input sequence has no seven-member increasing subsequences. The longest increasing subsequence in this example is not the only solution: for instance,
0, 4, 6, 9, 11, 15
0, 2, 6, 9, 13, 15
0, 4, 6, 9, 13, 15
are other increasing subsequences of equal length in the same input sequence.
Following the algorithm in Wikipedia article, I put together this Python function: