Ctrl K

Numbers of Even Length

Easy
You are given an array of positive integers numbers. Count how many of them have an even number of digits when written in decimal.
Example 1
numbers=[48, 7, 1203, 999, 50000] → 2

48 (two digits) and 1203 (four digits) have an even digit count. 7, 999 and 50000 have one, three and five digits.

Example 2
numbers=[3, 141, 59265, 2147483647] → 1

3, 141 and 59265 have one, three and five digits. Only 2147483647, with ten digits, has an even count.

Example 3
numbers=[10, 100000] → 2
Constraints
  • 1 ≤ len(numbers) ≤ 500
  • 1 ≤ numbers[i] ≤ 2³¹ − 1
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsAdd One to a Digit Array EasyThe Lost Ticket EasyCorner Stamps on a Table EasyBest Product of Three EasyThe Biggest Triangle on the Board Easy
loading Python…
Input
numbers=[48, 7, 1203, 999, 50000]
Expected
2

Run checks the first 3 tests in your browser. Submit checks all 102 tests on the server, hidden ones included.