Climbing Stairs

You are climbing a staircase that requires n steps to reach the top. You can climb either 1 or 2 steps at a time. Determine the number of distinct ways to climb to the top.

Constraints

  • 1 <= n <= 45
Auto-saved · 3 lines
class Solution:
def climbingStairs(self, n: int) -> int:

Console

Click Run to execute sample tests.