File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed
src/main/java/g3001_3100/s3072_distribute_elements_into_two_arrays_ii Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change 66import java .util .Arrays ;
77
88public class Solution {
9- static class BIT {
9+ private static class BIT {
1010 private final int [] tree ;
1111
1212 public BIT (int size ) {
@@ -26,7 +26,6 @@ public int rsq(int ind) {
2626 sum += tree [ind ];
2727 ind -= lsb (ind );
2828 }
29-
3029 return sum ;
3130 }
3231
@@ -47,7 +46,6 @@ public int[] resultArray(int[] source) {
4746 bit1 .update (nums [0 ]);
4847 BIT bit2 = new BIT (nums .length );
4948 bit2 .update (nums [1 ]);
50-
5149 for (int i = 2 ; i < nums .length ; i ++) {
5250 int g1 = p1 + 1 - bit1 .rsq (nums [i ]);
5351 int g2 = p2 + 1 - bit2 .rsq (nums [i ]);
@@ -61,11 +59,9 @@ public int[] resultArray(int[] source) {
6159 bit1 .update (nums [i ]);
6260 }
6361 }
64-
6562 for (int i = p1 + 1 ; i < arr1 .length ; i ++) {
6663 arr1 [i ] = arr2 [i - p1 - 1 ];
6764 }
68-
6965 return arr1 ;
7066 }
7167
You can’t perform that action at this time.
0 commit comments