mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 08:16:50 +08:00
feat(ZeroOneKnapsack.js): Fixed bad code
This commit is contained in:
@ -50,10 +50,9 @@ const main = () => {
|
|||||||
arr.push(input[j])
|
arr.push(input[j])
|
||||||
j++
|
j++
|
||||||
}
|
}
|
||||||
const newArr = []
|
const newArr = arr.map(e =>
|
||||||
arr.map(e => {
|
e.trim().split(' ').map(Number)
|
||||||
newArr.push(e.trim().split(' ').map(Number))
|
)
|
||||||
})
|
|
||||||
const cache = []
|
const cache = []
|
||||||
for (let i = 0; i <= currlen; i++) {
|
for (let i = 0; i <= currlen; i++) {
|
||||||
const temp = []
|
const temp = []
|
||||||
|
Reference in New Issue
Block a user