Loading content...
You are ascending a staircase that consists of exactly n steps to reach the summit. On each move, you have the choice to advance by either 1 step or 2 steps at a time.
Determine the total number of distinct sequences of moves that will take you from the ground level to the top of the staircase.
Each unique ordering of 1-step and 2-step moves that results in reaching exactly n steps is considered a separate path, even if the total count of each step type is the same.
n = 22There are exactly two distinct ways to reach the 2nd step:
Both sequences successfully reach the summit.
n = 33There are exactly three distinct ways to ascend 3 steps:
Note that paths 2 and 3 are distinct because the order of moves differs.
n = 58The 8 distinct paths to reach step 5 are:
Constraints