nums.countArray to store the count of numbers with a certain number of set bits.countArray at the index equal to the number of set bits in the number.count to store the number of excellent pairs.countArray and for each pair of indices (bit, bit_), if their sum is greater than or equal to k, increment count by countArray[bit] * countArray[bit_].count.