Skip to content

Commit 139e89d

Browse files
committed
num of 1 bits solution
1 parent 26ce291 commit 139e89d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

number-of-1-bits/dylan-jung.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Solution {
2+
public:
3+
int hammingWeight(int n) {
4+
return popcount((unsigned int)n);
5+
}
6+
};

0 commit comments

Comments
 (0)