Variation of Longest Increasing Subsequence