Skip to content

Commit 3f755cf

Browse files
Update ZeroOneKnapsack.js
1 parent 3ab272d commit 3f755cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Dynamic-Programming/ZeroOneKnapsack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* https://en.wikipedia.org/wiki/Knapsack_problem
44
*/
55

6-
function zeroOneKnapsack (arr, n, cap, cache) {
6+
const zeroOneKnapsack = (arr, n, cap, cache) => {
77
if (cap === 0 || n === 0) {
88
cache[n][cap] = 0
99
return cache[n][cap]
@@ -20,7 +20,7 @@ function zeroOneKnapsack (arr, n, cap, cache) {
2020
}
2121
}
2222

23-
function main () {
23+
const main = () => {
2424
/*
2525
Problem Statement:
2626
You are a thief carrying a single bag with limited capacity S. The museum you stole had N artifact that you could steal. Unfortunately you might not be able to steal all the artifact because of your limited bag capacity.

0 commit comments

Comments
 (0)