most optimal algo for counting set bits in integer in constant timw code example Example: bit counting countBits = (n) => n.toString(2).split("0").join("").length;