# Leetcode 377 - Combination sum IV

`Note:`

- This is a
`complete knapsack`

problem. - Iterate
`j`

first because we care about the orders of elements.`{1,2}`

and`{2, 1}`

are two different arrays. - Iterate
`i`

and`j`

in`ascending`

order because we can add an element`multi`

times.

Given an array of distinct integers nums and a target integer target, return the number of possible combinations that add up to target.

The answer is guaranteed to fit in a 32-bit integer.

**Example:**

1 | Input: nums = [1,2,3], target = 4 |

1 | /** |