← Amazon questions

Minimize cost of combining elements from array

Filed under Amazon

Given an array of costs, repeatedly take two elements, add their sum to a running total, and insert the sum back into the array. Minimize the total cost until one element remains.

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.