From 660c73782a5ea9afb25e8395e285534312e9ae38 Mon Sep 17 00:00:00 2001 From: Sathish <100967068+sathish-pv@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:49:16 +0530 Subject: [PATCH 1/2] feat(dynamic programming -> knapsack): Update invalid example comment --- dynamic_programming/knapsack.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dynamic_programming/knapsack.ts b/dynamic_programming/knapsack.ts index 0bc51012..b3236461 100644 --- a/dynamic_programming/knapsack.ts +++ b/dynamic_programming/knapsack.ts @@ -6,7 +6,7 @@ * @returns Maximum value subset such that sum of the weights of this subset is smaller than or equal to capacity * @throws If weights and values arrays have different lengths * @see [Knapsack](https://www.geeksforgeeks.org/0-1-knapsack-problem-dp-10/) - * @example knapsack(3, [3, 4, 5], [30, 50, 60]) // Output: 90 + * @example knapsack(3, [3, 4, 5], [30, 50, 60]) // Output: 30 */ export const knapsack = ( From c4629a71cde92276c11ff976e4a769aafd8ed927 Mon Sep 17 00:00:00 2001 From: Sathish <100967068+sathish-pv@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:31:58 +0530 Subject: [PATCH 2/2] Update knapsack.ts --- dynamic_programming/knapsack.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dynamic_programming/knapsack.ts b/dynamic_programming/knapsack.ts index b3236461..c07896d2 100644 --- a/dynamic_programming/knapsack.ts +++ b/dynamic_programming/knapsack.ts @@ -6,7 +6,7 @@ * @returns Maximum value subset such that sum of the weights of this subset is smaller than or equal to capacity * @throws If weights and values arrays have different lengths * @see [Knapsack](https://www.geeksforgeeks.org/0-1-knapsack-problem-dp-10/) - * @example knapsack(3, [3, 4, 5], [30, 50, 60]) // Output: 30 + * @example knapsack(11, [1, 3, 4, 5, 6], [10, 30, 80, 50, 60]) // Output: 150 */ export const knapsack = (