Given a set of elements and a sum value, you need to find out all subsets of elements equal to the sum of value through backtracking. Set of elements = {5,8,6,7,6,10,5} Sum = 20
isSubsetSum(set, n, sum)
= isSubsetSum(set, n-1, sum) ||
isSubsetSum(set, n-1, sum-set[n-1])
Base Cases:
isSubsetSum(set, n, sum) = false, if sum > 0 and n == 0
isSubsetSum(set, n, sum) = true, if sum == 0