Skip to content

Commit ba3ebe1

Browse files
committed
Fixed sonar
1 parent cf1d8fb commit ba3ebe1

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/main/java/g3401_3500/s3470_permutations_iv/Solution.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class Solution {
1212
private long helper(int a, int b) {
1313
long res = 1;
1414
for (int i = 0; i < b; i++) {
15-
res *= (a - i);
15+
res *= a - i;
1616
if (res > INF) {
1717
return INF;
1818
}
@@ -24,25 +24,25 @@ private long solve(int odd, int even, int r, int req) {
2424
if (r == 0) {
2525
return 1;
2626
}
27-
int nodd;
28-
int neven;
27+
int nOdd;
28+
int nEven;
2929
if (req == 1) {
30-
nodd = (r + 1) / 2;
31-
neven = r / 2;
30+
nOdd = (r + 1) / 2;
31+
nEven = r / 2;
3232
} else {
33-
neven = (r + 1) / 2;
34-
nodd = r / 2;
33+
nEven = (r + 1) / 2;
34+
nOdd = r / 2;
3535
}
36-
if (odd < nodd || even < neven) {
36+
if (odd < nOdd || even < nEven) {
3737
return 0;
3838
}
39-
long oddways = helper(odd, nodd);
40-
long evenways = helper(even, neven);
41-
long total = oddways;
42-
if (evenways == 0 || total > INF / evenways) {
39+
long oddWays = helper(odd, nOdd);
40+
long evenWays = helper(even, nEven);
41+
long total = oddWays;
42+
if (evenWays == 0 || total > INF / evenWays) {
4343
total = INF;
4444
} else {
45-
total *= evenways;
45+
total *= evenWays;
4646
}
4747
return total;
4848
}

0 commit comments

Comments
 (0)