Finding all possible combinations of numbers to reach a given sum

How would you go about testing all possible combinations of additions from a given set N of numbers so they add up to a given final number? A brief example: Set of numbers to add: N = {1,5,22,15,0,…} Desired result: 12345 32 Answers 32 This problem can be solved with a recursive combinations of all … Read more