I did it with Sets any idea on how to do it without sets.
Any other method without sets?
yes ,you can take out all the subsequences using bitmasking or recursion , your wish.
and for each combination you can check whether sum equals k or not.
yes ,you can take out all the subsequences using bitmasking or recursion , your wish.
and for each combination you can check whether sum equals k or not.