I have a menu of n items, with each item having a value. Given the total amount spent, I have to figure out all the possible combinations of items purchased. Example, I have three menu items:
item 1: $4
item 2: $5
item 3: $8
with the total purchase price = $14
There is only one solution in the case, 1 purchase of item 1 and 2 purchases of item 2.
How do I go about solving this?