We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eb39fa7 commit e7b67b0Copy full SHA for e7b67b0
1 file changed
LeetCode/count1s.java
@@ -1,3 +1,4 @@
1
+//Write a function that takes an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight).
2
public class Solution {
3
// you need to treat n as an unsigned value
4
public int hammingWeight(int n) {
@@ -15,4 +16,4 @@ public int hammingWeight(int n) {
15
16
}
17
return cnt;
18
-}
19
+}
0 commit comments