I am looking for a way to get all possible combination of numbers to reach a specified target value. The values of the number set can repeat.
For example:
Number set is 4, 5, 6, 7, 8
The value that I want to reach is 16.
So as result I would like to have something like:
4+4+4+4
4+4+8
5+5+6
...
Any solutions which I've found are only without repeatitions like here:
Efficient algorithm to find a combination, which summation is equal to a known number, in a set of number
Thanks in advance!