Implement Longest Increasing Subsequence.