From b519d500d4e71a25472fa1616a7239d60faa20c1 Mon Sep 17 00:00:00 2001 From: CyC2018 Date: Wed, 28 Oct 2026 13:45:03 +0800 Subject: [PATCH] =?UTF-8?q?Update=2015.=20=E4=BA=8C=E8=BF=9B=E5=88=B6?= =?UTF-8?q?=E4=B8=AD=201=20=E7=9A=84=E4=B8=AA=E6=95=B0.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 题目链接改为力扣中的对应题目,题目描述和代码按该题的接口调整。 --- notes/15. 二进制中 1 的个数.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notes/15. 二进制中 1 的个数.md b/notes/15. 二进制中 1 的个数.md index bea92147..ff8c3d41 100644 --- a/notes/15. 二进制中 1 的个数.md +++ b/notes/15. 二进制中 1 的个数.md @@ -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++;