File tree 1 file changed +1
-5
lines changed
src/main/java/g3001_3100/s3072_distribute_elements_into_two_arrays_ii
1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change 6
6
import java .util .Arrays ;
7
7
8
8
public class Solution {
9
- static class BIT {
9
+ private static class BIT {
10
10
private final int [] tree ;
11
11
12
12
public BIT (int size ) {
@@ -26,7 +26,6 @@ public int rsq(int ind) {
26
26
sum += tree [ind ];
27
27
ind -= lsb (ind );
28
28
}
29
-
30
29
return sum ;
31
30
}
32
31
@@ -47,7 +46,6 @@ public int[] resultArray(int[] source) {
47
46
bit1 .update (nums [0 ]);
48
47
BIT bit2 = new BIT (nums .length );
49
48
bit2 .update (nums [1 ]);
50
-
51
49
for (int i = 2 ; i < nums .length ; i ++) {
52
50
int g1 = p1 + 1 - bit1 .rsq (nums [i ]);
53
51
int g2 = p2 + 1 - bit2 .rsq (nums [i ]);
@@ -61,11 +59,9 @@ public int[] resultArray(int[] source) {
61
59
bit1 .update (nums [i ]);
62
60
}
63
61
}
64
-
65
62
for (int i = p1 + 1 ; i < arr1 .length ; i ++) {
66
63
arr1 [i ] = arr2 [i - p1 - 1 ];
67
64
}
68
-
69
65
return arr1 ;
70
66
}
71
67
You can’t perform that action at this time.
0 commit comments