From 1e90883e7f05f8f9301abc16b126c039e1f97eed Mon Sep 17 00:00:00 2001 From: Calvin Date: Wed, 14 Aug 2019 11:10:27 -0700 Subject: [PATCH] knapsack01 problem fetches incorrect item weight --- recursion_dynamic/knapsack_01/knapsack_solution.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recursion_dynamic/knapsack_01/knapsack_solution.ipynb b/recursion_dynamic/knapsack_01/knapsack_solution.ipynb index aff4319..77501f8 100644 --- a/recursion_dynamic/knapsack_01/knapsack_solution.ipynb +++ b/recursion_dynamic/knapsack_01/knapsack_solution.ipynb @@ -193,8 +193,8 @@ " j -= 1\n", " else:\n", " results.append(items[i])\n", - " i -= 1\n", " j -= items[i].weight\n", + " i -= 1\n", " return results" ] },