This is a variant of the partition problem (see
http://en.wikipedia.org/wiki/Partition_problem
for details). In fact a solution to this can
solve that one (take an array, pad with 0s, and
then solve this problem) so this problem is NP
hard.

There is a dynamic programming approach that is
pseudo-polynomial. For each `i`

from
`0`

to the size of the array, you keep
track of all possible combinations of current
sizes for the sub arrays, and their current sums.
As long as there are a limited number possible
sums of subsets of the array, this runs acceptably
fast.

The solution that I would have suggested is to
just go for "good enough" closeness. First let's
consider the simpler problem with all values
positive. Then sort by value descending. Take
that array in threes. Build up the three subsets
by always adding the largest of the triple to the
one with the smallest sum, the smallest to the one
with the largest, and the middle to the middle.
You will end up dividing the array evenly, and the
difference will be no more than the value of the
third smallest element.

For the general case you can divide into
positive and negative, use the above approach on
each, and then brute force all combinations of a
group of positives, a group of negatives, and the
few leftover values in the middle that did not
divide evenly.