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.