Count Numbers with Even Number of Digits
Complete the function below. The function receives the full standard input as a single string and must return the exact standard output lines for the described problem.
Original prompt
Problem
Given an integer array nums (each number may have multiple digits and can include 0), return the count of elements whose number of digits in base-10 is even.
The number of digits of x is the length of its decimal representation. For example, 7 has 1 digit, 12 has 2 digits, and 0 has 1 digit.
Input
An integer array nums
Output
An integer: the count of numbers with an even number of digits Constraints (typical) 1 <= len(nums) <= 1e5 0 <= nums[i] <= 1e9
Examples
Input: [12, 345, 2, 6, 7896] → Output: 2 Input: [555, 901, 482, 1771] → Output: 1 Input: [0, 10, 100, 1000] → Output: 2 Input: [8] → Output: 0 Input: [22, 33, 4444, 5, 666666] → Output: 3
Complete solveOneCountEvenDigitNumbers. It has one parameter, String input, containing the full stdin payload. Return the stdout payload as an array of lines, without trailing newline characters.
1Example 1
The returned string must match the expected standard output for the sample input.
Constraints
Limits and guarantees your solution can rely on.
Use the limits and requirements stated in the prompt.