0%
1 2 3 4 5 6 7 8 9 10 11 12
| class Solution: def combinationSum4(self, nums: List[int], target: int) -> int: d = [0 for _ in range(target+1)] d[0] = 1 for j in range(1,target+1): for i in range(len(nums)): if j>=nums[i]: d[j] += d[j-nums[i]] return d[target]
|