File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed
src/main/java/g3601_3700/s3621_number_of_integers_with_popcount_depth_equal_to_k_i Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -6,12 +6,8 @@ public class Solution {
6
6
private static final int MX_LN = 61 ;
7
7
private final long [][] slct = new long [MX_LN ][MX_LN ];
8
8
private final int [] popHeight = new int [MX_LN ];
9
- private boolean strt = false ;
10
9
11
- private void setup () {
12
- if (strt ) {
13
- return ;
14
- }
10
+ public Solution () {
15
11
for (int i = 0 ; i < MX_LN ; i ++) {
16
12
slct [i ][0 ] = slct [i ][i ] = 1 ;
17
13
for (int j = 1 ; j < i ; j ++) {
@@ -22,7 +18,6 @@ private void setup() {
22
18
for (int v = 2 ; v < MX_LN ; v ++) {
23
19
popHeight [v ] = 1 + popHeight [Long .bitCount (v )];
24
20
}
25
- strt = true ;
26
21
}
27
22
28
23
private long countNumbers (long upperLimit , int setBits ) {
@@ -53,7 +48,6 @@ private long countNumbers(long upperLimit, int setBits) {
53
48
}
54
49
55
50
public long popcountDepth (long tillNumber , int depthQuery ) {
56
- setup ();
57
51
if (depthQuery == 0 ) {
58
52
return tillNumber >= 1 ? 1 : 0 ;
59
53
}
You can’t perform that action at this time.
0 commit comments