Capital OneOA #13
Count Numbers with Even Number of Digits
Estimated EasyJudge-ready
Topics (AI-labelled)StringsBits & Math
Given an integer array nums, count the elements whose decimal representation has an even number of digits. The decimal representation of 0 has one digit.
Input
The first line contains n (1≤n≤100000), and the second line contains n integers (0≤nums[i]≤10^9). The length and value constraints are common ranges adopted by this site; digit counts are based on the decimal representation.
Output
Output the number of elements with an even number of digits.
Example 1
Input:
5
12 345 2 6 7896
Output:
2
Example 2
Input:
4
555 901 482 1771
Output:
1
Example 3
Input:
4
0 10 100 1000
Output:
2
Editorial
Loading solution…