mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 11:43:12 +08:00 
			
		
		
		
	国外版
This commit is contained in:
		
							
								
								
									
										21
									
								
								算法题(国外版)/find-all-numbers-disappeared-in-an-array.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								算法题(国外版)/find-all-numbers-disappeared-in-an-array.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
<p>Given an array <code>nums</code> of <code>n</code> integers where <code>nums[i]</code> is in the range <code>[1, n]</code>, return <em>an array of all the integers in the range</em> <code>[1, n]</code> <em>that do not appear in</em> <code>nums</code>.</p>
 | 
			
		||||
 | 
			
		||||
<p> </p>
 | 
			
		||||
<p><strong>Example 1:</strong></p>
 | 
			
		||||
<pre><strong>Input:</strong> nums = [4,3,2,7,8,2,3,1]
 | 
			
		||||
<strong>Output:</strong> [5,6]
 | 
			
		||||
</pre><p><strong>Example 2:</strong></p>
 | 
			
		||||
<pre><strong>Input:</strong> nums = [1,1]
 | 
			
		||||
<strong>Output:</strong> [2]
 | 
			
		||||
</pre>
 | 
			
		||||
<p> </p>
 | 
			
		||||
<p><strong>Constraints:</strong></p>
 | 
			
		||||
 | 
			
		||||
<ul>
 | 
			
		||||
	<li><code>n == nums.length</code></li>
 | 
			
		||||
	<li><code>1 <= n <= 10<sup>5</sup></code></li>
 | 
			
		||||
	<li><code>1 <= nums[i] <= n</code></li>
 | 
			
		||||
</ul>
 | 
			
		||||
 | 
			
		||||
<p> </p>
 | 
			
		||||
<p><strong>Follow up:</strong> Could you do it without extra space and in <code>O(n)</code> runtime? You may assume the returned list does not count as extra space.</p>
 | 
			
		||||
		Reference in New Issue
	
	Block a user