update longest increasing sequence alg