From 3f755cfbdaee9a4a4c6591d63c2f66edd1fc9f09 Mon Sep 17 00:00:00 2001 From: Anup Kumar Panwar <1anuppanwar@gmail.com> Date: Tue, 6 Oct 2020 11:11:31 +0530 Subject: [PATCH] Update ZeroOneKnapsack.js --- Dynamic-Programming/ZeroOneKnapsack.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dynamic-Programming/ZeroOneKnapsack.js b/Dynamic-Programming/ZeroOneKnapsack.js index e418db1ae..0274fdefd 100644 --- a/Dynamic-Programming/ZeroOneKnapsack.js +++ b/Dynamic-Programming/ZeroOneKnapsack.js @@ -3,7 +3,7 @@ * https://en.wikipedia.org/wiki/Knapsack_problem */ -function zeroOneKnapsack (arr, n, cap, cache) { +const zeroOneKnapsack = (arr, n, cap, cache) => { if (cap === 0 || n === 0) { cache[n][cap] = 0 return cache[n][cap] @@ -20,7 +20,7 @@ function zeroOneKnapsack (arr, n, cap, cache) { } } -function main () { +const main = () => { /* Problem Statement: 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.