```
struct Solution {
int combinationSum4(vector<int>& nums, int target) {
int dp[target + 1] = {1} ;
for (int i = 1; i <= target; ++i)
for (int j = 1; j <= nums.size(); ++ j)
if (nums[j - 1] <= i)
dp[i] += dp[i - nums[j - 1]];
return dp[target];
}
};
```