We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 660c737 commit c4629a7Copy full SHA for c4629a7
dynamic_programming/knapsack.ts
@@ -6,7 +6,7 @@
6
* @returns Maximum value subset such that sum of the weights of this subset is smaller than or equal to capacity
7
* @throws If weights and values arrays have different lengths
8
* @see [Knapsack](https://www.geeksforgeeks.org/0-1-knapsack-problem-dp-10/)
9
- * @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
10
*/
11
12
export const knapsack = (
0 commit comments