2
public long wonderfulSubstrings(String word) {8
[(1 << 10) + 1]; // Since we have to take only 2^10 possibilies, we can avoid an HashMap12
0; // initialize the frequency of 0000000000 as 1 because when no element is encountered,13
// then th bitmask is 015
for (int i = 0; i < n; i++) {16
int mask = (1 << (word.charAt(i) - 'a'));18
mask; // toggling bit of the current character to make it from odd to even OR even to odd24
j++) { // Loop for checking all possiblities of different places of the Different Bit25
count += freq[chkMask ^ res];29
freq[res]++; // increasing the frequency of the current bitmask