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)/数组中数字出现的次数 [shu-zu-zhong-shu-zi-chu-xian-de-ci-shu-lcof].html
2022-03-29 12:43:11 +08:00

25 lines
642 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> 里除两个数字之外其他数字都出现了两次。请写程序找出这两个只出现一次的数字。要求时间复杂度是O(n)空间复杂度是O(1)。</p>
<p>&nbsp;</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>&nbsp;</p>
<p><strong>限制:</strong></p>
<ul>
<li><code>2 &lt;= nums.length &lt;= 10000</code></li>
</ul>
<p>&nbsp;</p>