mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
25 lines
642 B
HTML
25 lines
642 B
HTML
<p>一个整型数组 <code>nums</code> 里除两个数字之外,其他数字都出现了两次。请写程序找出这两个只出现一次的数字。要求时间复杂度是O(n),空间复杂度是O(1)。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>示例 1:</strong></p>
|
||
|
||
<pre><strong>输入:</strong>nums = [4,1,4,6]
|
||
<strong>输出:</strong>[1,6] 或 [6,1]
|
||
</pre>
|
||
|
||
<p><strong>示例 2:</strong></p>
|
||
|
||
<pre><strong>输入:</strong>nums = [1,2,10,4,1,4,3,3]
|
||
<strong>输出:</strong>[2,10] 或 [10,2]</pre>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>限制:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>2 <= nums.length <= 10000</code></li>
|
||
</ul>
|
||
|
||
<p> </p>
|