We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 580ba46 commit d7eaa52Copy full SHA for d7eaa52
my-submissions/e2483.py
@@ -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