Sum it Up Backtracking problem


I am not able to use SET data structure please edit my code,I dont know how to store in SET.

you use set correctly.
in your input there are two 1’s so when you find a subsequence 1 1 6 whose sum is 8 you insert it into set but set has a property that it insert only unique values so 1 will insert only one time.