Algorithm visualizer
Pick an algorithm, enter your own numbers or use a preset, then step through the run. The pseudocode and the explanation follow each step.
Count the ways to reach step n when each move climbs 1 or 2 steps. Each count is the sum of the two counts before it.
Compute the answer for n = 10 on paper using the recurrence. Then check it against the table.
Step 1 of 8
cell being filled cells it depends on
ways[0] = 1: there is one way to stand at the start.