update the longest increasing subsequence problem