def longest_monotonic_subseq_length_loose(xs):
    li = longest_increasing_subseq_length_loose(xs)
    ld = longest_decreasing_subseq_length_loose(xs)
    return max(li, ld), li - ld
dataset/ETHPy150Open tanghaibao/jcvi/algorithms/lis.py/longest_monotonic_subseq_length_loose/original