Count Numbers with an Even Digit Count
Updated
Problem statement
Given an array of positive integers numbers, count how many values have an even number of decimal digits.
Return that count.
Function
countEvenDigitNumbers(numbers: int[]) → intExamples
Example 1
numbers = [12, 134, 111, 1111, 10]return = 3The values 12, 1111, and 10 have two, four, and two digits, respectively.
Example 2
numbers = [1, 10, 999, 1000, 10000]return = 2Only 10 and 1000 have an even number of digits.
Constraints
1 <= numbers.length <= 10001 <= numbers[i] <= 10^4
More ZipRecruiter Online Assessment questions
- Four-Level Banking System with Scheduled PaymentsOA · Seen Oct 2026
- Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
- Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
- Minimum Changes to Draw a YOA · Seen Oct 2024
- Apply Binary State OperationsOA · Seen Sep 2024
- Simulate Orchard Rot SpreadOA · Seen Sep 2024
- Compare Odd- and Even-Index SumsOA · Seen Sep 2024
- Coordinate Removals with Column GravityOA · Seen Sep 2024
- Lexicographically Smallest End ReversalOA · Seen Sep 2024
- Recursively Expanded Shell Command CountsOA · Seen Sep 2024
Similar questions at other companies
- Total Cost Against the Lowest Earlier PricePayPal · OAPayPal interview questions
- Count Valid Square PairsAuxoAI · OA
- Picked Player Who LostSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
- Server InvestmentRippling · OARippling interview questions
- Basic Item DiscountsPalantir · OAPalantir interview questions
- Next Pascal Row CoefficientIntuit · OAIntuit interview questions
- Unique Integers That Sum to ZeroNVIDIA · OANVIDIA interview questions
- Count Multiples of Three with Two SevensHudson River Trading · OAHudson River Trading interview questions
- Diagonal Bounce TraversalAutodesk · OAAutodesk interview questions
- Maximum Student-Teacher DistanceChubb · OAChubb interview questions