<doocs>0918.Maximum Sum Circular Subarray_1.py
def maxSubarraySumCircular( nums: List[int]) -> int:
    s1 = s2 = f1 = f2 = nums[0]
    for num in nums[1:]:
        f1 = num + max(f1, 0)
        f2 = num + min(f2, 0)
        s1 = max(s1, f1)
        s2 = min(s2, f2)
    return s1 if s1 <= 0 else max(s1, sum(nums) - s2)
def sample_funcname ( var_0 : List [ int ] ) -> int :
    var_7 = var_3 = var_4 = var_5 = var_0 [ 0 ]
    for var_9 in var_0 [ 1 : ] :
        var_4 = var_9 + max ( var_4 , 0 )
        var_5 = var_9 + min ( var_5 , 0 )
        var_7 = max ( var_7 , var_4 )
        var_3 = min ( var_3 , var_5 )
    return var_7 if var_7 <= 0 else max ( var_7 , sum ( var_0 ) - var_3 )
