Skip to content

Commit 88578a2

Browse files
committed
fix: remove the globale scope and use a default argument in the function signature
1 parent 66cfc34 commit 88578a2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎Sprint-2/improve_with_caches/fibonacci/fibonacci.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
fib_cache = {}
2-
def fibonacci(n):
1+
2+
def fibonacci(n: int, fib_cache: dict[int, int] = {0: 0, 1: 1}) -> int:
33
if n <= 1:
44
return n
55
#check if already calc this num.

0 commit comments

Comments
 (0)