find the longest increasing subsequence