We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe4af68 commit 2ac0cc7Copy full SHA for 2ac0cc7
problems/191.number-of-1-bits.md
@@ -131,14 +131,13 @@ Java Code:
131
```java
132
public class Solution {
133
public int hammingWeight(int n) {
134
- //空间复杂度实际为O(1)
135
- int ret = 0;
+ int count = 0;
136
for (int i = 0; i < 32; i++) {
137
if ((n & (1 << i)) != 0) {
138
- ret++;
+ count++;
139
}
140
141
- return ret;
+ return count;
142
143
144
```
0 commit comments