Created
May 17, 2022 08:42
-
-
Save mym0404/7bd1d6a975fb6f06bb37bd33024e3c2a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
n = 100 | |
checked = [-1 for _ in range(n)] | |
def fib(i): | |
if i <= 2: return 1 | |
global checked | |
if checked[i] != -1: | |
return checked[i] | |
checked[i] = fib(i - 2) + fib(i - 1) | |
return checked[i] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment