Skip to content

Commit d7eaa52

Browse files
committed
Do daily
1 parent 580ba46 commit d7eaa52

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

my-submissions/e2483.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution:
2+
def countSymmetricIntegers(self, low: int, high: int) -> int:
3+
output = 0
4+
helper = (lambda x: sum(map(int, x[:len(x) // 2])) == sum(map(int, x[len(x) // 2:])))
5+
while low <= high :
6+
if len(str(low)) % 2 == 1 :
7+
low = 10 ** ceil(log(low + 1, 10))
8+
continue
9+
if helper(str(low)) :
10+
output += 1
11+
low += 1
12+
return output
13+

0 commit comments

Comments
 (0)