Given an integer array nums, define the rotation function F(k) as the sum of i * nums[(i + k) % n] for each index i, where n is the length of nums.
Return the maximum value of F(k) over all possible rotations k.
Constraints:
n == nums.length
1 <= n <= 10^5
-100 <= nums[i] <= 100
Given an integer array nums, define the rotation function F(k) as the sum of i * nums[(i + k) % n] for each index i, where n is the length of nums.
Return the maximum value of F(k) over all possible rotations k.
Constraints:
n == nums.length
1 <= n <= 10^5
-100 <= nums[i] <= 100