<doocs>1546.Maximum Number of Non-Overlapping Subarrays With Sum Equals Target_1.py
def maxNonOverlapping( nums: List[int], target: int) -> int:
    i, n = 0, len(nums)
    ans = 0
    while i < n:
        s = 0
        seen = {0}
        while i < n:
            s += nums[i]
            if s - target in seen:
                ans += 1
                break
            i += 1
            seen.add(s)
        i += 1
    return ans
def sample_funcname ( var_0 : List [ int ] , var_3 : int ) -> int :
    var_5 , var_7 = 0 , len ( var_0 )
    var_8 = 0
    while var_5 < var_7 :
        var_9 = 0
        var_10 = { 0 }
        while var_5 < var_7 :
            var_9 += var_0 [ var_5 ]
            if var_9 - var_3 in var_10 :
                var_8 += 1
                break
            var_5 += 1
            var_10.add ( var_9 )
        var_5 += 1
    return var_8
