class Solution { public: vector a; bool f(int p,int left,vector& c,vector& ans) { if(left<0) return 0; if(left==0) return 1; //vector a; if(f(p,left-c[p],c,ans)) a.push_back(c[p]); f(p+1,left-c[p],c,ans); f(p+1,left,c,ans); } vector> combinationSum(vector& candidates, int target) { vector> x; f(0,target,candidates,x); return x; } };