<doocs>0376.Wiggle Subsequence_1.py
def wiggleMaxLength( nums: List[int]) -> int:
    up = down = 1
    for i in range(1, len(nums)):
        if nums[i] > nums[i - 1]:
            up = max(up, down + 1)
        elif nums[i] < nums[i - 1]:
            down = max(down, up + 1)
    return max(up, down)
def sample_funcname ( var_0 : List [ int ] ) -> int :
    var_5 = var_3 = 1
    for var_8 in range ( 1 , len ( var_0 ) ) :
        if var_0 [ var_8 ] > var_0 [ var_8 - 1 ] :
            var_5 = max ( var_5 , var_3 + 1 )
        elif var_0 [ var_8 ] < var_0 [ var_8 - 1 ] :
            var_3 = max ( var_3 , var_5 + 1 )
    return max ( var_5 , var_3 )
