Skip to content

Commit e1a1fb4

Browse files
committed
clang format fixes
1 parent 0a51008 commit e1a1fb4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/java/com/thealgorithms/dynamicprogramming/LongestArithmeticSubsequence.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ public static int getLongestArithmeticSubsequenceLength(int[] nums) {
2121
if (nums == null) {
2222
throw new IllegalArgumentException("Input array cannot be null");
2323
}
24-
24+
2525
// If the array is empty or has only one element, return its length.
26-
if (nums.length == 1 || nums.length == 0) {
27-
return nums.length;
26+
if (nums.length == 0) {
27+
return 0;
28+
}
29+
30+
if (nums.length == 1){
31+
return 1;
2832
}
2933

3034
HashMap<Integer, Integer>[] dp = new HashMap[nums.length];

0 commit comments

Comments
 (0)