Climbing Stairs
Easy1 ptDynamic ProgrammingMathRecursion
PrerequisitesDynamic Programming, Recursion, Math
You can climb 1 or 2 steps at a time. How many distinct ways to reach step n?
Input: integer n.
Output: number of ways.
Hints
Video
8 lines
Input (stdin)
Expected output · optional
Run checks your code against every example, one by one — all must pass. Type your own input above to run that instead (Run compares it to the expected output if you set one). The full suite is checked on Submit — a failing case reveals its input & expected output.
