1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/数组中两个数的最大异或值 [maximum-xor-of-two-numbers-in-an-array].html

31 lines
772 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给你一个整数数组 <code>nums</code> ,返回<em> </em><code>nums[i] XOR nums[j]</code> 的最大运算结果,其中 <code>0 ≤ i ≤ j &lt; n</code></p>
<p>&nbsp;</p>
<div class="original__bRMd">
<div>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>nums = [3,10,5,25,2,8]
<strong>输出:</strong>28
<strong>解释:</strong>最大运算结果是 5 XOR 25 = 28.</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>nums = [14,70,53,83,49,91,36,80,92,51,66,70]
<strong>输出:</strong>127
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= nums.length &lt;= 2 * 10<sup>5</sup></code></li>
<li><code>0 &lt;= nums[i] &lt;= 2<sup>31</sup> - 1</code></li>
</ul>
</div>
</div>