Cool. I knew (guessed) it was too easy, but it worked for several test sets. Thanks for the explanation.
Actually, scrap the above, because according to the wikipedia page,
The most common formulation of the problem is the 0-1 knapsack problem, which restricts the number xj of copies of each kind of item to zero or one.
So you can't have 2 of one item?
In reply to Re^3: knapsack problem solved by regex
by BrowserUk
in thread knapsack problem solved by regex
by rubasov
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |