Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 423 Bytes

File metadata and controls

15 lines (11 loc) · 423 Bytes

Problem 1: The Staircase Ascent (Climbing Stairs)

Problem Statement

You are climbing a staircase with n steps. Each time you can climb 1 or 2 steps. In how many distinct ways can you climb to the top?

Input Format

  • An integer n.

Constraints

  • 1 <= n <= 45

Example

Input: n = 5
Output: 8
Explanation: (1+1+1+1+1), (1+1+1+2), (1+1+2+1), (1+2+1+1), (2+1+1+1), (1+2+2), (2+1+2), (2+2+1).