dynamic_programming.longest_increasing_subsequence_o_nlogn

Functions

ceil_index(v, left, right, key)

longest_increasing_subsequence_length(→ int)

Module Contents

dynamic_programming.longest_increasing_subsequence_o_nlogn.ceil_index(v, left, right, key)
dynamic_programming.longest_increasing_subsequence_o_nlogn.longest_increasing_subsequence_length(v: list[int]) int
>>> longest_increasing_subsequence_length([2, 5, 3, 7, 11, 8, 10, 13, 6])
6
>>> longest_increasing_subsequence_length([])
0
>>> longest_increasing_subsequence_length([0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13,
...                                     3, 11, 7, 15])
6
>>> longest_increasing_subsequence_length([5, 4, 3, 2, 1])
1