LearnPy Hub
← Recursion & Lambda problems
Medium

Ways to Climb Stairs

You can climb 1 or 2 steps at a time. Write a recursive function (with memoisation using a dictionary) that returns how many ways there are to climb n steps. Read n and print it.

Input

One integer 1–60.

Output

One integer.

Sample 1

Input
4
Output
5

Sample 2

Input
1
Output
1
solution.py
Output appears here
Ways to Climb Stairs · Python practice problem · LearnPy Hub