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_3 = sum ( var_1 * var_2 for var_1 , var_2 in enumerate ( var_0 ) )
      var_4 , var_5 = len ( var_0 ) , sum ( var_0 )
      var_6 = var_3
      for var_1 in range ( 1 , var_4 ) :
          var_3 = var_3 + var_5 - var_4 * var_0 [ var_4 - var_1 ]
          var_6 = max ( var_6 , var_3 )
      return var_6
  