Skip to content

Commit 05ac73d

Browse files
more pythonic for 1295
1 parent 04a8846 commit 05ac73d

File tree

1 file changed

+1
-6
lines changed
  • src/1295-Find-Numbers-with-Even-Number-of-Digits

1 file changed

+1
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
class Solution:
22
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
3+
return sum(map(lambda n: len(str(n)) % 2 == 0, nums))

0 commit comments

Comments
 (0)