File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
1
# Time: O(logn)
2
- # Space: O(logn
2
+ # Space: O(logn)
3
3
4
4
class Solution (object ):
5
5
def confusingNumberII (self , N ):
@@ -28,7 +28,7 @@ def totalCount(N):
28
28
p //= len (lookup )
29
29
return total
30
30
31
- def lessValidCount (N ):
31
+ def validCountInLessLength (N ):
32
32
s = str (N )
33
33
valid = 0
34
34
total = len (centers )
@@ -44,7 +44,7 @@ def lessValidCount(N):
44
44
total *= len (lookup )
45
45
return valid
46
46
47
- def equalValidCount (N ):
47
+ def validCountInFullLength (N ):
48
48
s = str (N )
49
49
half_s = s [:(len (s )+ 1 )// 2 ]
50
50
total = 0
@@ -76,5 +76,4 @@ def equalValidCount(N):
76
76
p //= len (lookup )
77
77
return total
78
78
79
- return totalCount (N ) - lessValidCount (N ) - equalValidCount (N )
80
-
79
+ return totalCount (N ) - validCountInLessLength (N ) - validCountInFullLength (N )
You can’t perform that action at this time.
0 commit comments