We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8dcfb31 commit ee971d2Copy full SHA for ee971d2
src/main/java/com/thealgorithms/dynamicprogramming/Knapsack.java
@@ -15,7 +15,6 @@ public final class Knapsack {
15
private Knapsack() {
16
}
17
18
- // Validate input for knapsack problem, otherwise throws exception
19
private static void throwIfInvalidInput(final int weightCapacity, final int[] weights, final int[] values) {
20
if (weightCapacity < 0) {
21
throw new IllegalArgumentException("Weight capacity should not be negative.");
0 commit comments