Update 15. 二进制中 1 的个数.md

题目链接改为力扣中的对应题目,题目描述和代码按该题的接口调整。
This commit is contained in:
CyC2018
2026-10-28 13:45:03 +08:00
parent 75ad4dda7c
commit b519d500d4
+2 -2
View File
@@ -2,7 +2,7 @@
## 题目链接
[牛客网](https://www.nowcoder.com/practice/8ee967e43c2c4ec193b040ea7fbb10b8?tpId=13&tqId=11164&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
[Leetcode](https://leetcode.cn/problems/er-jin-zhi-zhong-1de-ge-shu-lcof/)
## 题目描述
@@ -16,7 +16,7 @@ n&(n-1) 位运算可以将 n 的位级表示中最低的那一位 1 设置为 0
```java
public int NumberOf1(int n) {
public int hammingWeight(int n) {
int cnt = 0;
while (n != 0) {
cnt++;