diff --git a/exercises/practice/knapsack/.meta/example.nim b/exercises/practice/knapsack/.meta/example.nim index 51e2adf6..6bb576be 100644 --- a/exercises/practice/knapsack/.meta/example.nim +++ b/exercises/practice/knapsack/.meta/example.nim @@ -1,7 +1,7 @@ type Item = tuple[weight: int, value: int] proc maximumValue*(maximumWeight: int, items: openArray[Item]): int = - var dp = newSeq[int](maximumWeight + 1) + var dp = newSeq[int](maximumWeight + 1) for item in items: for weight in countdown(maximumWeight, item.weight): dp[weight] = max(dp[weight], item.value + dp[weight - item.weight])