This commit is contained in:
Volodymyr Baliasnikov 2026-12-01 20:17:15 +01:00
parent 5c1173266d
commit eebd290a9d

10
u11/knapsack.py Normal file
View File

@ -0,0 +1,10 @@
from functools import lru_cache
def maximum_value(maximum_weight, items):
for w in maximum_weight:
if maximum_weight < w:
continue
@lru_cache
def helper(i,w):
if i == len(items) or i == 0: