mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 19:53:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			545 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			545 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>某班级 n 位同学的学号为 0 ~ n-1。点名结果记录于升序数组 <code>records</code>。假定仅有一位同学缺席,请返回他的学号。</p>
 | 
						|
 | 
						|
<p> </p>
 | 
						|
 | 
						|
<p><strong>示例 1:</strong></p>
 | 
						|
 | 
						|
<pre>
 | 
						|
<strong>输入:</strong> records = [0,1,2,3,5]
 | 
						|
<strong>输出:</strong> 4
 | 
						|
</pre>
 | 
						|
 | 
						|
<p><strong>示例 2:</strong></p>
 | 
						|
 | 
						|
<pre>
 | 
						|
<strong>输入:</strong> records = [0, 1, 2, 3, 4, 5, 6, 8]
 | 
						|
<strong>输出:</strong> 7</pre>
 | 
						|
 | 
						|
<p> </p>
 | 
						|
 | 
						|
<p><b>提示:</b></p>
 | 
						|
 | 
						|
<p><code>1 <= records.length <= 10000</code></p>
 |