Back to problems

Even Digit Count

Algorithm · Capital One · Easy

Requirements You receive an array of positive integers named numbers. Determine the number of entries in numbers whose decimal representation contains an even count of digits. Produce that total as an integer. Limits: 1 <= numbers.length <= 1000 and 1 <= numbers[i] <= 10^4. Although the time limit permits O(numbers.length^2), a single linear pass is more straightforward. Examples The qualifying values are 45, 2500, and 99, since each has an even-length decimal form. Notes…

Checking your access…