Nice article!
If I could provide some suggestion here, in the second for loop, all those lines of if conditions and isEven() function call can be reduced to pairs += counts[item] / 2 | 0 to get the integer division value.
for (const item in counts)
pairs += counts[item] / 2 | 0;
Biplob Manna
I do interesting things when I get bored!
Nice article!
If I could provide some suggestion here, in the second for loop, all those lines of
ifconditions andisEven()function call can be reduced topairs += counts[item] / 2 | 0to get the integer division value.for (const item in counts) pairs += counts[item] / 2 | 0;