Skip to content

Commit 52c4f7a

Browse files
committed
Fix Checkstyle NeedBraces and format NearestElement.java
1 parent 6c7d8da commit 52c4f7a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/java/com/thealgorithms/stacks/NearestElement.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
*/
1414
public final class NearestElement {
1515
// Private constructor to prevent instantiation
16-
private NearestElement() {}
16+
private NearestElement() {
17+
}
1718

1819
/** Finds the nearest greater element to the right for each element in the array. */
1920
public static int[] nearestGreaterToRight(int[] arr) {
@@ -98,4 +99,4 @@ public static int[] nearestSmallerToLeft(int[] arr) {
9899

99100
return result;
100101
}
101-
}
102+
}

src/test/java/com/thealgorithms/stacks/NearestElementTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ void testNullInput() {
5858
assertThrows(IllegalArgumentException.class, () -> NearestElement.nearestSmallerToRight(null));
5959
assertThrows(IllegalArgumentException.class, () -> NearestElement.nearestSmallerToLeft(null));
6060
}
61-
}
61+
}

0 commit comments

Comments
 (0)