Suppose I have the array:
array(1,1,2,1,4,5,7,2,3);
What would be the fastest way to get these numbers into x arrays we'll use 3 and have the numbers be as equal as possible with the larger numbers at the end?
Example:
array(1, 1, 1, 5);
array(7, 2);
array(4, 2, 3);
I'm worried that this might be a p=np problem but it seems so simple that it shouldn't be. I just can't seem to figure it out.
Similar question: Algorithm to split an array into P subarrays of balanced sum