Longest increasing subsequence

Please checkout this question