Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (20 sloc) 466 Bytes
class Solution:
def findLengthOfLCIS(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if not nums:
return 0
m = 0
length = 0
last = nums[0] - 1
for i in nums:
if i > last:
length += 1
last = i
else:
m = max(m, length)
length = 1
last = i
return max(m, length)
You can’t perform that action at this time.