update longest increasing subsequence