We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 19b4ced commit 660c737Copy full SHA for 660c737
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: 90
+ * @example knapsack(3, [3, 4, 5], [30, 50, 60]) // Output: 30
10
*/
11
12
export const knapsack = (
0 commit comments