Skip to content

Commit 0fe8df0

Browse files
committed
191. 位1的个数
1 parent c0f15fe commit 0fe8df0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.gatsby;
2+
3+
/**
4+
* @ClassName: _191NumberOfOneBits
5+
* @Description: leetcode 191 位1的数量
6+
* @author: Gatsby
7+
* @date: 2022/5/17 11:49
8+
*/
9+
10+
public class _191NumberOfOneBits {
11+
public int hammingWeight(int n) {
12+
return Integer.bitCount(n);
13+
}
14+
}
15+
16+

0 commit comments

Comments
 (0)