Say we have a number sequence, and we have X sections to divide this into:
1, 4, 7, 9, 3, 11, 10
If we had 3 sections, the optimal answer would be:
[1, 4, 7][9, 3][11, 10] or [1, 4, 7, 9][3, 11][10]
Since the largest sum = 21. This is the best case. (I think, I did it by hand).
We want each section to be as equal as possible. How can this be done? My first attempt at an algorithm was to find the highest X values (9, 11, 10), and base the regions off of that. That does not work in an example like below, since one of the regions will NOT contain one of the highest values in the set:
3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
Again with X=3 sections, optimal answer:
[3, 2][2, 1, 1, 1][1, 1, 1, 1, 1]
Of course I could brute force every possible combination, but there is a much more efficient way of doing this. But I'm having trouble finding it.