Given an array of distinct positive integers `nums` and a `target`, return the number of ordered combinations (sequences) of nums elements that add up to target. Different orderings count as different combinations.
Examples
in: nums = [1,2,3], target = 4
out: 7
sequences like (1,1,1,1), (1,3), (3,1), etc.
Constraints
1 <= len(nums) <= 200
1 <= nums[i] <= 1000
1 <= target <= 1000
Hints
target: O(target * len(nums)) time⌘↩ run · ⇧⌘↩ submit