Variation of 0/1 Knapsack Problem


Since we need to divide the array into 2 subsets, we can see that the ideal minimum absolute difference will be 0, and it can be achieved when we can pick values that add up to ‘half of sum of all items.’ Use this sum/2 as capacity of knapsack.