dp for longest increasing subsequence