Let\'s say there is a set of number
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
I want to find out several combinations in the set of number s
A possible alternative method. With a small set like this, you could use brute force. Your set {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} has 10 elements, and each element can be present or not present. That can be mapped to a binary number between 0 (= 0b0000000000) and 1023 (= 0b1111111111). Loop through the numbers from 0 to 1023, inclusive, and check the sum for the subset corresponding to the set bits of the binary representation of the number.
Maybe not the most useful for this particular question, but a good way to generate all possible subsets of a given set.