Leetcode 1421 Solution

This article provides solution to leetcode question 1421 (find-numbers-with-even-number-of-digits)

https://leetcode.com/problems/find-numbers-with-even-number-of-digits

Solution

class Solution:
    def findNumbers(self, nums: List[int]) -> int:
        ans = 0
        for num in nums:
            if len(str(num)) % 2 == 0:
                ans += 1
        return ans