Imagine that I have a N long set of numbers. I would like to know the possible ways that I could reach a specific sum using only the numbers in my set. As an example:
sum to be reached is 60
set of numbers contains:
10,18,7
output: case 1 : 10 (6 times)
case 2 : 10 (2 times), 7 (2 times), 18 (2 times)
etc...
Is there an algorithm/concept I could use for this? Thank you.
Ok, as nobody answered this question I will provide what I came up with using help from the comments in my initial question. The solution utilizes recursion and is programmed in java. It may not be the most efficient method but it works.