Solved LeetCode program · 70 of 1,000
#0070 · Climbing Stairs
Original English source
The target is 5. The size is target plus 1. The ways is a list of size zeros. Set item 0 of ways to 1.
For every position from 1 to target.
If position is 1, set item position of ways to 1. If position is more than 1, set item position of ways to item (position minus 1) of ways plus item (position minus 2) of ways.
Display item target of ways.
Expected stdout
8