Log in
← All problems

Climbing stairs

mediumRecursion20 XP

You climb a staircase of n steps, taking 1 or 2 steps at a time. Return how many different ways there are to reach the top. (Plain recursion is slow for big n — remember answers you've already worked out.)

Examples

Examples use JSON: true/false/null are True/False/None in Python.

Run examples checks the examples above. Submit also runs 4 hidden tests.