JuniorArrayMath

Find Numbers with Even Number of Digits

Given an array nums of integers, return how many of them contain an even number of digits.

Example 1
Inputnums = [12,345,2,6,7896]
Output2
12 and 7896 contain an even number of digits, while 345, 2, and 6 do not.
Example 2
Inputnums = [555,901,482,1771]
Output1
Only 1771 contains an even number of digits.

Constraints

  • 1 <= nums.length <= 500
  • 1 <= nums[i] <= 10^5

Asked at 7 companies

</>

Your Solution

(Ctrl/Cmd + Enter)

Switching Language

Loading template...

Loading...

Sign in to save your progress

AI code evaluation

Get a correctness verdict, missed edge cases, and complexity analysis of your solution.

Sign in to evaluate