comefrom: <doocs>1031.Maximum Sum of Two Non-Overlapping Subarrays_1.py
code: def maxSumTwoNoOverlap( nums: List[int], firstLen: int, secondLen: int) -> int:
      n = len(nums)
      s = [0] * (n + 1)
      for i in range(1, n + 1):
          s[i] = s[i - 1] + nums[i - 1]
      ans1, ans2, fm, sm = 0, 0, 0, 0
      for i in range(n - firstLen - secondLen + 1):
          fm = max(fm, s[i + firstLen] - s[i])
          ans1 = max(fm + s[i + firstLen + secondLen] - s[i + firstLen], ans1)
      for i in range(n - firstLen - secondLen + 1):
          sm = max(sm, s[i + secondLen] - s[i])
          ans2 = max(sm + s[i + firstLen + secondLen] - s[i + secondLen], ans2)
      return max(ans1, ans2)
masked: def sample_funcname ( var_0 : List [ int ] , var_1 : int , var_2 : int ) -> int :
      var_3 = len ( var_0 )
      var_4 = [ 0 ] * ( var_3 + 1 )
      for var_5 in range ( 1 , var_3 + 1 ) :
          var_4 [ var_5 ] = var_4 [ var_5 - 1 ] + var_0 [ var_5 - 1 ]
      var_6 , var_7 , var_8 , var_9 = 0 , 0 , 0 , 0
      for var_5 in range ( var_3 - var_1 - var_2 + 1 ) :
          var_8 = max ( var_8 , var_4 [ var_5 + var_1 ] - var_4 [ var_5 ] )
          var_6 = max ( var_8 + var_4 [ var_5 + var_1 + var_2 ] - var_4 [ var_5 + var_1 ] , var_6 )
      for var_5 in range ( var_3 - var_1 - var_2 + 1 ) :
          var_9 = max ( var_9 , var_4 [ var_5 + var_2 ] - var_4 [ var_5 ] )
          var_7 = max ( var_9 + var_4 [ var_5 + var_1 + var_2 ] - var_4 [ var_5 + var_2 ] , var_7 )
      return max ( var_6 , var_7 )
  