We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa8858b commit 34c5eddCopy full SHA for 34c5edd
DynamicProgramming/Knapsack.java
@@ -26,7 +26,6 @@ public static void main(String args[]) {
26
int val[] = new int[] {50, 100, 130};
27
int wt[] = new int[] {10, 20, 40};
28
int W = 50;
29
- int n = val.length;
30
- System.out.println(knapSack(W, wt, val, n));
+ System.out.println(knapSack(W, wt, val, val.length));
31
}
32
0 commit comments