I added a code for counting all the set bits in binary form of a number but apart from the trivial approach , I used a new - Brian Kernighan Algorithm that says if we subtract 1 from a number 'N' , it flips all the bits after the rightmost set bit in the binary .
I added a code for counting all the set bits in binary form of a number but apart from the trivial approach , I used a new - Brian Kernighan Algorithm that says if we subtract 1 from a number 'N' , it flips all the bits after the rightmost set bit in the binary .