I recently came across this post
The solution given is elegant and it got me thinking. What if we are not allowed to sort the list and can only take 2 adjacent elements i.e at indcies $x,x+1$ (this also includes first and last numbers, it is like a round circle of numbers)and sum them instead of any 2 elements at random indices. What could the optimal algorithm be?
One naive way would be to always take the minimum 2 elements and perform exactly what is given in the link. But this doesn't seem efficient to me.
Can someone prove/provide a better way to approach this?
Update: After a comment, i would like to add this for further clarification about how the sum of numbers is being done
We are interested in an accumulated sum. Consider an a, b, c list. Select a, b. The list becomes a+b, c and the acc sum becomes a+b. On the next step the list reduces to a+b+c, and the acc sum becomes (a+b) + ((a+b) + c) = 2a + 2b + c. Working from another end we'd achieve a + 2b + 2c.
Now , from above, we would want to minimize the answer.