mirror of
https://github.com/donnemartin/interactive-coding-challenges.git
synced 2024-03-22 13:11:13 +08:00
knapsack01 problem fetches incorrect item weight
This commit is contained in:
parent
e0bde79ddd
commit
1e90883e7f
|
@ -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"
|
||||
]
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user