We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5bd29a8 commit 5fc041cCopy full SHA for 5fc041c
src/main/java/com/eknv/algorithms/arrays/SmallestNumberNotSumOfSubset.java
@@ -23,7 +23,7 @@ public static int calculate(int[] numbers) {
23
Assert.notNull(numbers, "numbers");
24
25
if (numbers.length == 0) {
26
- throw new RuntimeException("The list cannot be empty");
+ throw new IllegalArgumentException("The list cannot be empty");
27
}
28
29
validateIsSorted(numbers);
@@ -88,7 +88,7 @@ private static void validateIsSorted(int[] numbers) {
88
for (int i = 0; i < numbers.length; i++) {
89
90
if (numbers[i] < prevValue) {
91
- throw new RuntimeException("This array is not sorted");
+ throw new IllegalArgumentException("This array is not sorted");
92
} else {
93
prevValue = numbers[i];
94
0 commit comments