let arrs=[102,233,45,350,130,220,195,240]
I want arrs to split into two groups, but I want the sum of the two groups to be as close as possible. The smaller the difference, the better. My own idea is to re-sort, from small to large, and then judge the subscript to divide into two groups, odd group, even group, or the first two minimum values and the last two maximum values as a group, and the middle four as a group.
do you have a more accurate way to get the minimum difference?