We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 799f809 commit e1b8e92Copy full SHA for e1b8e92
Sprint-2/improve_with_caches/fibonacci/fibonacci.py
@@ -1,11 +1,11 @@
1
-cache = {}
+fibonacci_cache = {}
2
3
def fibonacci(n):
4
- if(n) in cache:
5
- return cache[n]
+ if(n) in fibonacci_cache:
+ return fibonacci_cache[n]
6
if n <= 1:
7
return n
8
9
result = fibonacci(n - 1) + fibonacci(n - 2)
10
- cache[n] = result
+ fibonacci_cache[n] = result
11
return result
0 commit comments