Skip to content

Commit 2417856

Browse files
committed
Improved task
1 parent f7ca9f5 commit 2417856

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

1 file changed

+1
-7
lines changed

src/main/java/g3601_3700/s3621_number_of_integers_with_popcount_depth_equal_to_k_i/Solution.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@ public class Solution {
66
private static final int MX_LN = 61;
77
private final long[][] slct = new long[MX_LN][MX_LN];
88
private final int[] popHeight = new int[MX_LN];
9-
private boolean strt = false;
109

11-
private void setup() {
12-
if (strt) {
13-
return;
14-
}
10+
public Solution() {
1511
for (int i = 0; i < MX_LN; i++) {
1612
slct[i][0] = slct[i][i] = 1;
1713
for (int j = 1; j < i; j++) {
@@ -22,7 +18,6 @@ private void setup() {
2218
for (int v = 2; v < MX_LN; v++) {
2319
popHeight[v] = 1 + popHeight[Long.bitCount(v)];
2420
}
25-
strt = true;
2621
}
2722

2823
private long countNumbers(long upperLimit, int setBits) {
@@ -53,7 +48,6 @@ private long countNumbers(long upperLimit, int setBits) {
5348
}
5449

5550
public long popcountDepth(long tillNumber, int depthQuery) {
56-
setup();
5751
if (depthQuery == 0) {
5852
return tillNumber >= 1 ? 1 : 0;
5953
}

0 commit comments

Comments
 (0)