mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-24 14:28:56 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你两个整数 <code>left</code> 和 <code>right</code> ,在闭区间 <code>[left, right]</code> 范围内,统计并返回 <strong>计算置位位数为质数</strong> 的整数个数。</p>\n\n<p><strong>计算置位位数</strong> 就是二进制表示中 <code>1</code> 的个数。</p>\n\n<ul>\n\t<li>例如, <code>21</code> 的二进制表示 <code>10101</code> 有 <code>3</code> 个计算置位。</li>\n</ul>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>left = 6, right = 10\n<strong>输出:</strong>4\n<strong>解释:</strong>\n6 -> 110 (2 个计算置位,2 是质数)\n7 -> 111 (3 个计算置位,3 是质数)\n9 -> 1001 (2 个计算置位,2 是质数)\n10-> 1010 (2 个计算置位,2 是质数)\n共计 4 个计算置位为质数的数字。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>left = 10, right = 15\n<strong>输出:</strong>5\n<strong>解释:</strong>\n10 -> 1010 (2 个计算置位, 2 是质数)\n11 -> 1011 (3 个计算置位, 3 是质数)\n12 -> 1100 (2 个计算置位, 2 是质数)\n13 -> 1101 (3 个计算置位, 3 是质数)\n14 -> 1110 (3 个计算置位, 3 是质数)\n15 -> 1111 (4 个计算置位, 4 不是质数)\n共计 5 个计算置位为质数的数字。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= left <= right <= 10<sup>6</sup></code></li>\n\t<li><code>0 <= right - left <= 10<sup>4</sup></code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 70,
|
||||
"likes": 129,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Number of 1 Bits\", \"titleSlug\": \"number-of-1-bits\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u4f4d1\\u7684\\u4e2a\\u6570\"}]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"20.2K\", \"totalSubmission\": \"28.5K\", \"totalAcceptedRaw\": 20164, \"totalSubmissionRaw\": 28544, \"acRate\": \"70.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"51K\", \"totalSubmission\": \"67.4K\", \"totalAcceptedRaw\": 51038, \"totalSubmissionRaw\": 67432, \"acRate\": \"75.7%\"}",
|
||||
"hints": [
|
||||
"Write a helper function to count the number of set bits in a number, then check whether the number of set bits is 2, 3, 5, 7, 11, 13, 17 or 19."
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user