Problem · Array
Count Numbers with Even Number of Digits
Given an array of positive integers numbers, calculate how many of its elements have an even number of digits.
The number of digits of a positive integer x is the length of its base-10 decimal representation. For example, 7 has 1 digit, 12 has 2 digits, and 1111 has 4 digits.
The function receives the full standard input as a single string (space-separated integers) and must return the exact standard output lines for the described problem.
Examples
01 · Example 1
input = "12 345 2 6 7896" return = ["2"]
The returned string must match the expected standard output for the sample input.
Constraints
1 ≤ numbers.length ≤ 10001 ≤ numbers[i] ≤ 104
More Capital One problems
- Compare Counts Around PivotOA · Seen Jun 2026
- Reconstruct Landmark JourneyOA · Seen Jun 2026
- Count House Segments After DestructionOA · Seen May 2026
- Laser Robot Safe PathOA · Seen May 2026
- Longest Same-Character SubstringOA · Seen May 2026
- Cyclic Shift to Strictly Descending ArrayOA · Seen May 2026
- Dynamic Wall Building and Range QueryOA · Seen May 2026
- Queue Check-in Simulation with Capacity LimitOA · Seen May 2026
public String[] solveOneCountEvenDigitNumbers(String input) {
// write your code here
}
input"12 345 2 6 7896"
expected["2"]
checking account