mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 19:53:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
		
			973 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			973 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>给你一个整数数组 <code>nums</code>,请你返回其中位数为 <strong>偶数</strong> 的数字的个数。</p>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>示例 1:</strong></p>
 | 
						||
 | 
						||
<pre><strong>输入:</strong>nums = [12,345,2,6,7896]
 | 
						||
<strong>输出:</strong>2
 | 
						||
<strong>解释:
 | 
						||
</strong>12 是 2 位数字(位数为偶数) 
 | 
						||
345 是 3 位数字(位数为奇数)  
 | 
						||
2 是 1 位数字(位数为奇数) 
 | 
						||
6 是 1 位数字 位数为奇数) 
 | 
						||
7896 是 4 位数字(位数为偶数)  
 | 
						||
因此只有 12 和 7896 是位数为偶数的数字
 | 
						||
</pre>
 | 
						||
 | 
						||
<p><strong>示例 2:</strong></p>
 | 
						||
 | 
						||
<pre><strong>输入:</strong>nums = [555,901,482,1771]
 | 
						||
<strong>输出:</strong>1 
 | 
						||
<strong>解释: </strong>
 | 
						||
只有 1771 是位数为偶数的数字。
 | 
						||
</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>提示:</strong></p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li><code>1 <= nums.length <= 500</code></li>
 | 
						||
	<li><code>1 <= nums[i] <= 10^5</code></li>
 | 
						||
</ul>
 |