mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 19:53:12 +08:00 
			
		
		
		
	add scripts and problemset
This commit is contained in:
		
							
								
								
									
										33
									
								
								算法题/find-numbers-with-even-number-of-digits.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								算法题/find-numbers-with-even-number-of-digits.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
<p>Given an array <code>nums</code> of integers, return how many of them contain an <strong>even number</strong> of digits.</p>
 | 
			
		||||
 | 
			
		||||
<p> </p>
 | 
			
		||||
<p><strong>Example 1:</strong></p>
 | 
			
		||||
 | 
			
		||||
<pre>
 | 
			
		||||
<strong>Input:</strong> nums = [12,345,2,6,7896]
 | 
			
		||||
<strong>Output:</strong> 2
 | 
			
		||||
<strong>Explanation: 
 | 
			
		||||
</strong>12 contains 2 digits (even number of digits). 
 | 
			
		||||
345 contains 3 digits (odd number of digits). 
 | 
			
		||||
2 contains 1 digit (odd number of digits). 
 | 
			
		||||
6 contains 1 digit (odd number of digits). 
 | 
			
		||||
7896 contains 4 digits (even number of digits). 
 | 
			
		||||
Therefore only 12 and 7896 contain an even number of digits.
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
<p><strong>Example 2:</strong></p>
 | 
			
		||||
 | 
			
		||||
<pre>
 | 
			
		||||
<strong>Input:</strong> nums = [555,901,482,1771]
 | 
			
		||||
<strong>Output:</strong> 1 
 | 
			
		||||
<strong>Explanation: </strong>
 | 
			
		||||
Only 1771 contains an even number of digits.
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
<p> </p>
 | 
			
		||||
<p><strong>Constraints:</strong></p>
 | 
			
		||||
 | 
			
		||||
<ul>
 | 
			
		||||
	<li><code>1 <= nums.length <= 500</code></li>
 | 
			
		||||
	<li><code>1 <= nums[i] <= 10<sup>5</sup></code></li>
 | 
			
		||||
</ul>
 | 
			
		||||
		Reference in New Issue
	
	Block a user