Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 448 Bytes

README.md

File metadata and controls

24 lines (17 loc) · 448 Bytes

Unique ways to climb a staircase

This problem was asked by Amazon.

Description

There exists a staircase with N steps, and you can climb up either 1 or 2 steps at a time.

Given N, write a function that returns the number of unique ways you can climb the staircase. The order of the steps matters.

Examples

Input:  
  n: 4
  output: 5

  Output explanation:
    - 1, 1, 1, 1
    - 2, 1, 1
    - 1, 2, 1
    - 1, 1, 2
    - 2, 2