add O(n^2) longest increasing subsequence solution