Skip to content

Commit 4a42f8a

Browse files
committed
Fixed style
1 parent 6d4f3ee commit 4a42f8a

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

src/main/java/g3601_3700/s3674_minimum_operations_to_equalize_array/Solution.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
public class Solution {
66
public int minOperations(int[] nums) {
77
for (int num : nums) {
8-
if (num != nums[0]) return 1;
8+
if (num != nums[0]) {
9+
return 1;
10+
}
911
}
1012
return 0;
1113
}

src/main/java/g3601_3700/s3676_count_bowl_subarrays/Solution.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ public long bowlSubarrays(int[] nums) {
1515
int mid = stack.pop();
1616
if (!stack.isEmpty()) {
1717
int left = stack.peek();
18-
if (Math.min(nums[left], nums[i]) > nums[mid]) ++ans;
18+
if (Math.min(nums[left], nums[i]) > nums[mid]) {
19+
++ans;
20+
}
1921
}
2022
}
2123
stack.push(i);

src/main/java/g3601_3700/s3677_count_binary_palindromic_numbers/Solution.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
public class Solution {
66
private long makePalin(long left, boolean odd) {
77
long ans = left;
8-
if (odd) left = left >> 1;
8+
if (odd) {
9+
left = left >> 1;
10+
}
911
while (left > 0) {
1012
ans = (ans << 1) | (left & 1);
1113
left = left >> 1;
@@ -14,7 +16,9 @@ private long makePalin(long left, boolean odd) {
1416
}
1517

1618
public int countBinaryPalindromes(long n) {
17-
if (n == 0) return 1;
19+
if (n == 0) {
20+
return 1;
21+
}
1822
int len = 64 - Long.numberOfLeadingZeros(n);
1923
long count = 1;
2024
for (int i = 1; i < len; i++) {
@@ -25,7 +29,9 @@ public int countBinaryPalindromes(long n) {
2529
long prefix = n >> (len - half);
2630
long palin = makePalin(prefix, len % 2 == 1);
2731
count += (prefix - (1L << (half - 1)));
28-
if (palin <= n) ++count;
32+
if (palin <= n) {
33+
++count;
34+
}
2935
return (int) count;
3036
}
3137
}

0 commit comments

Comments
 (0)