first commit

This commit is contained in:
heinleinju104093 committed 2026-11-12 11:47:13 +01:00
commit 9615165024
21 files changed
+404

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
from functools import lru_cache
import functools
import time
def time_calculation(f):
@functools.wraps(f)
def wrapper(*args, **kwargs):
start = time.perf_counter()
result = f(*args, **kwargs)
end = time.perf_counter()
print(f"Dauer: {end-start:.4f} Sekunden")
return result
return wrapper
@time_calculation
@lru_cache(maxsize=None)
def ways(n):
if n <= 2:
return n
return ways(n-1) + ways(n-2)
print(ways(40))