I have an array with N elements (N is even): [2, 4, 8, ..., 2^N]. I need to split it to 2 arrays, each with N/2 elements and get minimal absolute values of difference between sums of this arrays.
For 2, 4, 8, 16 answer is (2+16)-(4+8)=6. Can anyone explain to me the math side of solving this problem (no brute force)? Would the solution be the same if the original array is range[1, N]?