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 {
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 }
You can’t perform that action at this time.
0 commit comments