knapsack01 problem fetches incorrect item weight

This commit is contained in:
Calvin 2019-08-14 11:10:27 -07:00
parent e0bde79ddd
commit 1e90883e7f

View File

@ -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"
]
},