mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 23:41:41 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<p>We have an array <code>arr</code> of non-negative integers.</p>
|
||||
<p>Given an integer array <code>arr</code>, return <em>the number of distinct bitwise ORs of all the non-empty subarrays of</em> <code>arr</code>.</p>
|
||||
|
||||
<p>For every (contiguous) subarray <code>sub = [arr[i], arr[i + 1], ..., arr[j]]</code> (with <code>i <= j</code>), we take the bitwise OR of all the elements in <code>sub</code>, obtaining a result <code>arr[i] | arr[i + 1] | ... | arr[j]</code>.</p>
|
||||
<p>The bitwise OR of a subarray is the bitwise OR of each integer in the subarray. The bitwise OR of a subarray of one integer is that integer.</p>
|
||||
|
||||
<p>Return the number of possible results. Results that occur more than once are only counted once in the final answer</p>
|
||||
<p>A <strong>subarray</strong> is a contiguous non-empty sequence of elements within an array.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> arr = [0]
|
||||
@@ -13,7 +13,7 @@
|
||||
<strong>Explanation:</strong> There is only one possible result: 0.
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
<p><strong class="example">Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> arr = [1,1,2]
|
||||
@@ -23,7 +23,7 @@ These yield the results 1, 1, 2, 1, 3, 3.
|
||||
There are 3 unique values, so the answer is 3.
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 3:</strong></p>
|
||||
<p><strong class="example">Example 3:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> arr = [1,2,4]
|
||||
@@ -35,6 +35,6 @@ There are 3 unique values, so the answer is 3.
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= nums.length <= 5 * 10<sup>4</sup></code></li>
|
||||
<li><code>0 <= nums[i] <= 10<sup>9</sup></code></li>
|
||||
<li><code>1 <= arr.length <= 5 * 10<sup>4</sup></code></li>
|
||||
<li><code>0 <= arr[i] <= 10<sup>9</sup></code></li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user