Count Numbers with an Even Digit Count
Updated
Problem statement
Given an array of positive integers numbers, count how many elements 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 ByteDance interview questions
- Sorted Absolute-Difference Sums Across Cyclic ShiftsOA · Seen Aug 2026
- Count House Segments After Sequential DestructionOA · Seen Aug 2026
- Sort Concentric Matrix Borders ClockwiseOA · Seen Aug 2026
- Count N-Queens PlacementsPHONE SCREEN · Seen Nov 2026
- Matrix EscapePHONE SCREEN · Seen Nov 2026
- Largest Number Below N from Reusable DigitsPHONE SCREEN · Seen Nov 2026
- Log Analyzer: Busiest Service in a Rolling WindowPHONE SCREEN · Seen Nov 2026
- Search a Row- and Column-Sorted MatrixONSITE INTERVIEW · Seen Nov 2026
- Majority ElementPHONE SCREEN · Seen Nov 2026
- Valid ParenthesesPHONE SCREEN · Seen Nov 2026
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
ByteDance interview experiences
- ByteDance TikTok USDS SWE Intern Interview: 1 Experience
- ByteDance MLE New Grad Interviews: 1 Experience
- ByteDance Security SRE Intern Phone Screens: 1 Experience
- ByteDance USDS New Grad SWE Phone Screen: 1 Experience
- ByteDance New Grad Data Engineer Video Interviews: 1 Experience
- ByteDance Trust & Safety Research Scientist Intern: 1 Experience