Kernighans Algorithm
easy
1. You are given a number n. 2. You have to count the number of set bits in the given number.
Constraints
1 <= n <= 10^9
Format
Input
A number n
Output
Number of set bits in n
Example
Sample Input
58
Sample Output
4
Question Video