class Solution { public: int sum = 0; void dfs(vector<int>& nums, int cur,int target) { if(cur>target) return; if(cur==target) { sum++; return; } for(int i = 0;i<nums.size();i++) { dfs(nums, cur+nums[i], target); } } int combination(vector<int>& nums, int target) { // write code here dfs(nums, 0, target); return sum; } };