Skip to content

Commit 01ea708

Browse files
committed
Fixed sonar
1 parent 57ceaad commit 01ea708

File tree

1 file changed

+2
-3
lines changed
  • src/main/java/g3101_3200/s3129_find_all_possible_stable_binary_arrays_i

1 file changed

+2
-3
lines changed

src/main/java/g3101_3200/s3129_find_all_possible_stable_binary_arrays_i/Solution.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
public class Solution {
66
private static final int MODULUS = (int) 1e9 + 7;
7-
private static final long MOD_LONG = MODULUS;
87

98
private int add(int x, int y) {
109
return (x + y) % MODULUS;
@@ -15,7 +14,7 @@ private int subtract(int x, int y) {
1514
}
1615

1716
private int multiply(int x, int y) {
18-
return (int) ((long) x * y % MOD_LONG);
17+
return (int) ((long) x * y % (long) MODULUS);
1918
}
2019

2120
public int numberOfStableArrays(int zero, int one, int limit) {
@@ -30,7 +29,7 @@ public int numberOfStableArrays(int zero, int one, int limit) {
3029
int[] row2;
3130
row0[0] = 1;
3231
for (int s = 1, sLim = s - limit; s <= max; s++, sLim++) {
33-
row2 = sLim > 0 ? lcn[sLim - 1] : null;
32+
row2 = sLim > 0 ? lcn[sLim - 1] : new int[] {};
3433
row1 = row0;
3534
row0 = lcn[s];
3635
int c;

0 commit comments

Comments
 (0)