question = https://hack.codingblocks.com/contests/c/452/1086
solution = https://ide.codingblocks.com/#/s/21900
The subset sum to target
https://ide.codingblocks.com/s/34719
I am not able to understand your code, but i have added my code for your reference. This code passes all the cases.
NOTE: Same problem can be solved using a 1D - DP, in same time complexity.
top down approach for subset sum target
hope this helps!!