### Backtracking II: equal division of batches

Suppose that you are given a set of N numbers representing stocks batches: some are positive, others are negative. The batches have the following values: {15, -3, 4, -1, -16, 5, 14, -13, 7, -6, 2, 1} Your task is to distribute these batches amongst 3 brothers. However… you need to be fair with all the brothers, hence the total dollar amount has to be exactly the same for all the brothers. First question is: is there a solution for this problem? Second: what is the solution? There are in general two approaches for solving this problem: dynamic programming or backtracking. The first one requires some constraints in terms of the values of the batches – if the batches for instance contain float numbers I’m pretty sure the dynamic programming won’t work. The second approach is the one shown in the previous blog post, which is backtracking, and to recap, here is the overall structure of backtracking solutions: Backtracking(Enumeration L, Solution S) { //Part 1 If (L is the final enume