The TransCompilator

Solved LeetCode program · 273 of 1,000

#0377 · Combination Sum IV

Medium Array chunk-06.md

Original English source

The nums is a list of 1, 2, and 3. The target is 4. The ways is a list of 5 zeros. Set item 0 of ways to 1.
For every total from 1 to 4.
For each value in nums.
If total is at least value.
The prior is total minus value. The add is item prior of ways. Increase item total of ways by add.

Show item 4 of ways.

Open in Playground Browse all 1,000 problems

Expected stdout

7