最长连续递增子序列-Python

关键点:贪心算法

def longest_continue_subseq(li):
    start = 0
    res = 0
    for i in range(1, len(li)):
        if li[i] <= li[i-1]:
            start = i
        res = max(res, i - start + 1)
    return res

返回最长子序列的长度:3

时刻记着自己要成为什么样的人!
原文地址:https://www.cnblogs.com/demo-deng/p/14714316.html