1 class Solution: 2 def findLengthOfLCIS(self, nums: List[int]) -> int: 3 ans = begin = 0 4 for i in range(len(nums)): 5 if i > 0 and nums[i] <= nums[i-1]: 6 begin = i 7 ans = max(ans,i-begin+1) 8 return ans
1 class Solution: 2 def findLengthOfLCIS(self, nums: List[int]) -> int: 3 ans = begin = 0 4 for i in range(len(nums)): 5 if i > 0 and nums[i] <= nums[i-1]: 6 begin = i 7 ans = max(ans,i-begin+1) 8 return ans