def longest_inc_subseq1(seq):
    end = []
    for val in seq:
        idx = bisect(end, val)
        if idx == len(end): end.append(val)
        else: end[idx] = val
    return len(end)
an iterative algorithm for the longest increasing subsequence problem
dataset/ETHPy150Open bt3gl/Python-and-Algorithms-and-Data-Structures/src/USEFUL/dynamic_programming/memoized_longest_inc_subseq.py/longest_inc_subseq1