It does not work for [ 8, 4, 4, 7, 6, 3 ]. This is an NP-complete problem http://en.wikipedia.org/wiki/Knapsack_problem. Which means there is no (known) solution in polynomial time. Applies to BrowserUK's solution as well.
In reply to Re^2: Divide an array into 2 subsets to verify their sum is equal or not.
by hdb
in thread Divide an array into 2 subsets to verify their sum is equal or not.
by bimleshsharma
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |