Class Solution
java.lang.Object
g1201_1300.s1295_find_numbers_with_even_number_of_digits.Solution
1295 - Find Numbers with Even Number of Digits.<p>Easy</p>
<p>Given an array <code>nums</code> of integers, return how many of them contain an <strong>even number</strong> of digits.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> nums = [12,345,2,6,7896]</p>
<p><strong>Output:</strong> 2</p>
<p><strong>Explanation:</strong></p>
<p>12 contains 2 digits (even number of digits).</p>
<p>345 contains 3 digits (odd number of digits).</p>
<p>2 contains 1 digit (odd number of digits).</p>
<p>6 contains 1 digit (odd number of digits).</p>
<p>7896 contains 4 digits (even number of digits).</p>
<p>Therefore only 12 and 7896 contain an even number of digits.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> nums = [555,901,482,1771]</p>
<p><strong>Output:</strong> 1</p>
<p><strong>Explanation:</strong> Only 1771 contains an even number of digits.</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>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
findNumbers
public int findNumbers(int[] nums)
-