mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-06-16 19:09:17 -04:00
glassdoor 2014
This commit is contained in:
parent
ee01cd9446
commit
4b1fe33f96
87 changed files with 313 additions and 112 deletions
|
@ -1,15 +0,0 @@
|
|||
#!/bin/python3
|
||||
|
||||
from functools import lru_cache
|
||||
|
||||
|
||||
@lru_cache(maxsize=20)
|
||||
def fib(n):
|
||||
if n < 2:
|
||||
return n
|
||||
return fib(n-1) + fib(n-2)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print([fib(n) for n in range(10)])
|
||||
print(fib.cache_info())
|
Loading…
Add table
Add a link
Reference in a new issue