```
int combinationSum4(int* nums, int numsSize, int target) {
int *dp = malloc(sizeof(int) * (target+1));
memset(dp, 0, sizeof(int) * (target+1));
int i;
dp[0] = 1;
for(i = 1; i <= target; i++){
int j;
for(j = 0; j < numsSize; j++){
if(i >= nums[j]){
dp[i] = dp[i] + dp[i-nums[j]];
}
}
}
return dp[target];
```

}