We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 04a8846 commit 05ac73dCopy full SHA for 05ac73d
src/1295-Find-Numbers-with-Even-Number-of-Digits/1295.py
@@ -1,8 +1,3 @@
1
class Solution:
2
def findNumbers(self, nums: List[int]) -> int:
3
- res = 0
4
- for n in nums:
5
- x = int(math.log(n, 10) + 1)
6
- if x % 2 == 0:
7
- res += 1
8
- return res
+ return sum(map(lambda n: len(str(n)) % 2 == 0, nums))
0 commit comments