Coding Challenge

Climbing Stairs

Easy
dynamic-programming

Count how many ways to climb to the top taking 1 or 2 steps.

Each move can climb 1 or 2 stairs. Return the number of distinct ways to reach stair n.

Examples

Input: n = 3

Output: 3

Constraints

  • 1 <= n

Preparing your coding workspace...