Longest Increasing Subsequence problem