Any other method without sets?


I did it with Sets any idea on how to do it 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.