Skip to content

Commit

Permalink
solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Bombardier256 committed Dec 5, 2024
1 parent 5891c38 commit 5ea67c1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,13 @@


def cache(func: Callable) -> Callable:
# Write your code here
pass
cache = dict()

def wraper(*args, **kwargs) -> int:
if args in cache:
print("Getting from cache")
else:
print("Calculating new result")
cache[args] = func(*args, **kwargs)
return cache[args]
return wraper

0 comments on commit 5ea67c1

Please sign in to comment.