implemented longest increasing subsequence algorithm