u11 test
This commit is contained in:
parent
5c1173266d
commit
eebd290a9d
10
u11/knapsack.py
Normal file
10
u11/knapsack.py
Normal 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:
|
||||||
Loading…
Reference in New Issue
Block a user