Longest increasing subsequence

FCC link

The longest increasing subsequence problem is to find a subsequence of a given sequence in which the subsequence's elements are in sorted order, lowest to highest, and in which the subsequence is as long as possible. An example:

For the following array:

$\{3, 10, 2, 1, 20\}$

Longest increasing sequence is:

$\{3, 10, 20\}$

For more information on this problem please see Wikipedia.

Test

{{test}}

Console output