mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-12 19:01:47 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,19 +1,21 @@
|
||||
<p>给定一个整数数组 <code>A</code>,找出索引为 (i, j, k) 的三元组,使得:</p>
|
||||
<p>给你一个整数数组 <code>nums</code> ,返回其中 <strong>按位与三元组</strong> 的数目。</p>
|
||||
|
||||
<p><strong>按位与三元组</strong> 是由下标 <code>(i, j, k)</code> 组成的三元组,并满足下述全部条件:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>0 <= i < A.length</code></li>
|
||||
<li><code>0 <= j < A.length</code></li>
|
||||
<li><code>0 <= k < A.length</code></li>
|
||||
<li><code>A[i] & A[j] & A[k] == 0</code>,其中 <code>&</code> 表示按位与(AND)操作符。</li>
|
||||
<li><code>0 <= i < nums.length</code></li>
|
||||
<li><code>0 <= j < nums.length</code></li>
|
||||
<li><code>0 <= k < nums.length</code></li>
|
||||
<li><code>nums[i] & nums[j] & nums[k] == 0</code> ,其中 <code>&</code> 表示按位与运算符。</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p> </p>
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<p><strong>示例:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>[2,1,3]
|
||||
<pre>
|
||||
<strong>输入:</strong>nums = [2,1,3]
|
||||
<strong>输出:</strong>12
|
||||
<strong>解释:</strong>我们可以选出如下 i, j, k 三元组:
|
||||
<strong>解释:</strong>可以选出如下 i, j, k 三元组:
|
||||
(i=0, j=0, k=1) : 2 & 2 & 1
|
||||
(i=0, j=1, k=0) : 2 & 1 & 2
|
||||
(i=0, j=1, k=1) : 2 & 1 & 1
|
||||
@@ -28,11 +30,18 @@
|
||||
(i=2, j=1, k=0) : 3 & 1 & 2
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>nums = [0,0,0]
|
||||
<strong>输出:</strong>27
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ol>
|
||||
<li><code>1 <= A.length <= 1000</code></li>
|
||||
<li><code>0 <= A[i] < 2^16</code></li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li><code>1 <= nums.length <= 1000</code></li>
|
||||
<li><code>0 <= nums[i] < 2<sup>16</sup></code></li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user