1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 19:18:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/算法题(国内版)/problem (Chinese)/数组中数字出现的次数 [shu-zu-zhong-shu-zi-chu-xian-de-ci-shu-lcof].html

25 lines
642 B
HTML
Raw Normal View History

2022-03-27 20:38:29 +08:00
<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>