Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 453 Bytes

File metadata and controls

15 lines (11 loc) · 453 Bytes

Problem 12: Stairway to Summit (Climbing Stairs)

Problem Statement

You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Solve using recursion.

Input Format

  • An integer n (number of steps).

Constraints

  • 1 <= n <= 45

Example

Input: n = 3
Output: 3
Explanation: There are three ways: (1+1+1), (1+2), (2+1).