Given an array of **distinct** integers `nums` and a target integer `target`, return the number of possible combinations that add up to `target`. The order of numbers in the combination **matters** (so permutations count separately). **Example:** Input: `nums = [1,2,3]`, `target = 4` Output: `7` Explanation: `(1,1,1,1), (1,1,2), (1,2,1), (1,3), (2,1,1), (2,2), (3,1)`
Unbounded Knapsack (ordered)
dp[i] = number of ordered ways to reach sum i. Because order matters, the outer loop is over targets (not nums), so each arrangement is counted separately.