Given an integer array nums, return the count of elements in nums whose decimal representation contains an even number of digits.
Constraints:
Input: nums = [8, 44, 100, 9999, 10000]-List[int]
Output: 2-int
Explanation: 44 has 2 digits and 9999 has 4 digits (both even), while the others have 1, 3, and 5 digits (odd).
Input: nums = [1, 3, 5, 7, 9, 11]-List[int]
Output: 1-int
Explanation: Only 11 has an even number of digits (2), and all other numbers have 1 digit.
Input: nums = [10, 20, 30, 40, 50, 60, 70, 80, 90]-List[int]
Output: 9-int
Explanation: Every element is a 2-digit number, so all 9 elements have an even number of digits.
Input: nums = [99999, 100000, 5000, 250, 2, 77, 8080]-List[int]
Output: 4-int
Explanation: The even-digit numbers are 100000 (6 digits), 5000 (4 digits), 77 (2 digits), and 8080 (4 digits), and the rest have an odd number of digits.
Now, let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem: