int getIndexOfBit(int n) {
    // return __builtin_popcountll(value & ~(0xffffffffffffffffULL >> n));
    int numMarkedBits = 0;
    for (int i = 0; i < n; i++) {
      if (hasBit(i)) {
        numMarkedBits++;
      }
    }
    return numMarkedBits;
  }
int getIndexOfBit(int n) {
    
    int numMarkedBits = 0;
    for (int i = 0; i < n; i++) {
      if (hasBit(i)) {
        numMarkedBits++;
      }
    }
    return numMarkedBits;
  }
int getIndexOfBit ( int n ) { // return __builtin_popcountll(value & ~(0xffffffffffffffffULL >> n)); int numMarkedBits = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( hasBit ( i ) ) { numMarkedBits ++ ; } } return numMarkedBits ; }
Gets the index of the specified bit in the set, which is the number of marked bits that appear
before the specified bit.
Gets the index of the specified bit in the set which is the number of marked bits that appear before the specified bit .