Climbing Stairs

Try to solve the Climbing Stairs problem.

Statement

You are climbing a staircase. It takes n steps to reach the top. Each time, you can either climb 11 or 22 steps. In how many distinct ways can you climb to the top?

Constraints:

  • 1≤1 \leq n ≤45\leq 45

Examples

Create a free account to view this lesson.

Continue your learning journey with a 14-day free trial.

By signing up, you agree to Educative's Terms of Service and Privacy Policy