Qm

Climbing ten steps one or two at a time

A staircase has 10 steps. With each stride you climb either 1 step or 2 steps. Two ways of climbing count as different if the sequence of strides is different (so 1-2 and 2-1 are different ways of climbing three steps).

How many different ways are there to climb the ten steps? Explain the pattern that makes the count easy.

Show a hint

Think about the last stride. It was either a 1 or a 2. What does that tell you about the number of ways to climb n steps in terms of smaller staircases?

Your answer

Solving needs a free account

Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.

Discussion

Sign in to join the discussion · reading is open to everyone

💡 Discussion rules

  1. No full solutions here. Hints and approaches only.
  2. Complexity, edge cases and intuition are the point.
  3. Interview experiences are welcome. Respect your NDAs.

Loading discussion…

Learn the concepts

The theory behind this question.

Related questions

Binary strings with no two 1s in a row1, 1, 2, 5, 14, 42, what next?A hundred empty glasses and the dregs1, 3, 4, 7, 11, 18, what next?Most regions from four circles
All questions →