Skip to content

Commit e72bdae

Browse files
committed
191
1 parent 315e110 commit e72bdae

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

191.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution {
2+
public:
3+
int hammingWeight(uint32_t n) {
4+
int count=0;
5+
while(n!=0){
6+
n=n&(n-1);
7+
count++;
8+
}
9+
return count ;
10+
11+
}
12+
};

0 commit comments

Comments
 (0)