Pattern: Dynamic Programming (1D DP) + Counting Permutations
Let's follow the same problem-solving template:
Given:
nums.target.Find the number of possible combinations that add up to target.
Important rule: The order of numbers matters.
For example:
nums = [1, 2, 3]target = 4
We need to find all possible ordered sequences whose sum equals 4.