โ† Amazon questions

Maximize sum of weighted array

Filed under Amazon

Given an array of size n, find the rotation index i that maximizes the sum S = 0*a[i] + 1*a[i+1] + ... + (n-1)*a[i-1] (indices modulo n).

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.