Skip to content
CampusEduX

Climbing Stairs

Easyjavapythonccppjavascript

You are climbing a staircase with N steps. Each move you can climb either 1 or 2 steps. Count the number of distinct ways to reach the top.

Input Format

A single line containing the integer N.

Output Format

Print the number of distinct ways.

Related Problems

  • House Robber
    Medium · java, python, c, cpp, javascript
    Solve Problem
  • 0/1 Knapsack
    Medium · java, python, c, cpp, javascript
    Solve Problem
  • Longest Common Subsequence
    Medium · java, python, c, cpp, javascript
    Solve Problem

Input (stdin)

Output

Run your code to see output here...