I have the Coin Changing problem except with a twist: instead of finding solutions from infinite coins to equal a single sum, find a list of solutions from a finite set of coins to be less-than a collection of sums.
(A great link to the classic problem is here)
(This is also similar to subset-sum problem, except with a set of targets instead of just one - link here)
A similar, but different and seemingly more difficult problem to code:
Given -
- A list of possible numeric values that all must be used [1, 9, 4, 1, 3, 2]
- A list of groups with a maximum total that can be achieved [(GroupA,17), (GroupB,1), (GroupC,5)]
Goal - Assign each numeric value from the list to a Group, so that all items are used with the following constraint: the total sum of the values for each group must not exceed the assigned maximum.
For example, this example might find 3 solutions:
[[GroupA,[9,4,1,3]], [GroupB, [1]], [GroupC, [2]],
[GroupA,[9,4,1,2]], [GroupB, [1]], [GroupC, [3]],
[GroupA,[9,2,1,3]], [GroupB, [1]], [GroupC, [4]]]