Order of filling
Warm-up · Trace the algorithm · about 4 min
Cell i of the climbing table reads cells i − 1 and i − 2, and cells 0 and 1 are base cases. Drag the five cells into the order a correct tabulation fills them.
Example 1
Input:
{"n":4}
Output:
[0,1,2,3,4]
Constraints
- The table has cells 0 to 4.
Learn the idea first: Tabulation: filling the table bottom-up, a visual lesson.
More Tabulation: filling the table bottom-up problems
- Fibonacci with a table Warm-up
- Fill the table by hand Warm-up
- Climbing stairs Standard
- Ways to make a total from 1, 3 and 4 Standard
- Spot the bug: table size Standard
- Tribonacci with O(1) space Challenge