mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-22 13:36:46 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个整数数组 <code>nums</code> ,请你找出 <code>nums</code> 子集 <strong>按位或</strong> 可能得到的<strong> </strong><strong>最大值</strong> ,并返回按位或能得到最大值的 <strong>不同非空子集的数目</strong> 。</p>\n\n<p>如果数组 <code>a</code> 可以由数组 <code>b</code> 删除一些元素(或不删除)得到,则认为数组 <code>a</code> 是数组 <code>b</code> 的一个 <strong>子集</strong> 。如果选中的元素下标位置不一样,则认为两个子集 <strong>不同</strong> 。</p>\n\n<p>对数组 <code>a</code> 执行 <strong>按位或</strong> ,结果等于 <code>a[0] <strong>OR</strong> a[1] <strong>OR</strong> ... <strong>OR</strong> a[a.length - 1]</code>(下标从 <strong>0</strong> 开始)。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [3,1]\n<strong>输出:</strong>2\n<strong>解释:</strong>子集按位或能得到的最大值是 3 。有 2 个子集按位或可以得到 3 :\n- [3]\n- [3,1]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [2,2,2]\n<strong>输出:</strong>7\n<strong>解释:</strong>[2,2,2] 的所有非空子集的按位或都可以得到 2 。总共有 2<sup>3</sup> - 1 = 7 个子集。\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [3,2,1,5]\n<strong>输出:</strong>6\n<strong>解释:</strong>子集按位或可能的最大值是 7 。有 6 个子集按位或可以得到 7 :\n- [3,5]\n- [3,1,5]\n- [3,2,5]\n- [3,2,1,5]\n- [2,5]\n- [2,1,5]</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 16</code></li>\n\t<li><code>1 <= nums[i] <= 10<sup>5</sup></code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 122,
|
||||
"likes": 124,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"32.9K\", \"totalSubmission\": \"40.2K\", \"totalAcceptedRaw\": 32889, \"totalSubmissionRaw\": 40179, \"acRate\": \"81.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"33.2K\", \"totalSubmission\": \"40.6K\", \"totalAcceptedRaw\": 33244, \"totalSubmissionRaw\": 40601, \"acRate\": \"81.9%\"}",
|
||||
"hints": [
|
||||
"Can we enumerate all possible subsets?",
|
||||
"The maximum bitwise-OR is the bitwise-OR of the whole array."
|
||||
|
Reference in New Issue
Block a user