comefrom: <doocs>0396.Rotate Function_1.py
code: def maxRotateFunction( nums: List[int]) -> int:
      f = sum(i * v for i, v in enumerate(nums))
      n, s = len(nums), sum(nums)
      ans = f
      for i in range(1, n):
          f = f + s - n * nums[n - i]
          ans = max(ans, f)
      return ans
masked: def sample_funcname ( var_0 : List [ int ] ) -> int :
      var_7 = sum ( var_4 * var_5 for var_4 , var_5 in enumerate ( var_0 ) )
      var_9 , var_10 = len ( var_0 ) , sum ( var_0 )
      var_11 = var_7
      for var_4 in range ( 1 , var_9 ) :
          var_7 = var_7 + var_10 - var_9 * var_0 [ var_9 - var_4 ]
          var_11 = max ( var_11 , var_7 )
      return var_11
  