Created
June 24, 2020 09:28
-
-
Save LarryKarani/e127e5a6f5f5b547aee03a73d786a556 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 5 Number of ways to Climb Stairs | |
def fib(n): | |
if n <= 1: | |
return n | |
return fib(n-1) + fib(n-2) | |
def staircase(n): | |
return fib(n + 1) | |
print(staircase(5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment