标签:sel ret col maxlength int list tco style bsp
1 class Solution: 2 def wiggleMaxLength(self, nums: List[int]) -> int: 3 n = len(nums) 4 if n == 0: 5 return 0 6 up,down = 1,1 7 for i in range(1,n): 8 if nums[i] > nums[i-1]: 9 up = down + 1 10 elif nums[i] < nums[i-1]: 11 down = up + 1 12 return max(up,down)
标签:sel ret col maxlength int list tco style bsp
原文地址:https://www.cnblogs.com/asenyang/p/11004170.html