Given the tuple (list, value):

$$\left(\left[x\_1, x\_2, \cdots x\_n\right], y\right)$$

You may choose two adjacent values in the list to modify the tuple as:

$$\left(\left[x\_1, x\_2, \cdots x\_{i-1}, (x\_i + x\_{i+1}), x\_{i+2} \cdots x\_n\right], y + x\_{i} + x\_{i+1}\right)$$

Iterate until:

$$\left(\left[\sum\_i x\_i\right], y + z\right)$$

What is the optimal set of choices that minimizes $z$?

Intuitively, you never want to operate on the largest number in the list. But the largest number in this list changes as you add values together. In other words, the optimal solution is not necessarily obtained by an optimal solution of a sub-problem.

A greedy solution would start by taking the smallest number in this list and adding it to the smaller of its adjacent numbers. This solution, while close, is not equivalent to the value returned by brute force search. This points to the fact the some locally optimal step is not globally optimal, which could be connected to the fact that the largest element of the list changes as values are added together.