|
2 | 2 |
|
3 | 3 | importjava.util.Arrays; |
4 | 4 |
|
5 | | -/** |
6 | | - * 1295. Find Numbers with Even Number of Digits |
7 | | - * |
8 | | - * Given an array nums of integers, return how many of them contain an even number of digits. |
9 | | - * |
10 | | - * Example 1: |
11 | | - * Input: nums = [12,345,2,6,7896] |
12 | | - * Output: 2 |
13 | | - * Explanation: |
14 | | - * 12 contains 2 digits (even number of digits). |
15 | | - * 345 contains 3 digits (odd number of digits). |
16 | | - * 2 contains 1 digit (odd number of digits). |
17 | | - * 6 contains 1 digit (odd number of digits). |
18 | | - * 7896 contains 4 digits (even number of digits). |
19 | | - * Therefore only 12 and 7896 contain an even number of digits. |
20 | | - * |
21 | | - * Example 2: |
22 | | - * Input: nums = [555,901,482,1771] |
23 | | - * Output: 1 |
24 | | - * Explanation: |
25 | | - * Only 1771 contains an even number of digits. |
26 | | - * |
27 | | - * Constraints: |
28 | | - * 1 <= nums.length <= 500 |
29 | | - * 1 <= nums[i] <= 10^5 |
30 | | - * */ |
31 | 5 | publicclass_1295 { |
32 | 6 | publicstaticclassSolution1 { |
33 | 7 | publicintfindNumbers(int[]nums) { |
|