Longest Increasing Subsequence


http://rosalind.info/problems/lgis/
Given: A positive integer n≤10000 followed by a permutation π of length n.

Return: A longest increasing subsequence of π, followed by a longest decreasing subsequence of π.