DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR CPP
Bit Tricks for Competitive Programming c ++
int countSetBits(int x) { int count = 0; while (x) { x &= (x-1); count++; } return count; }
Source by www.geeksforgeeks.org #
PREVIOUS
NEXT
Tagged:
#Bit
#Tricks
#Competitive
#Programming
ADD COMMENT
Topic
COMMENT
Name
2+6 =
Submit