Skip to content

Commit 2c7c3ef

Browse files
authored
Update confusing-number-ii.py
1 parent a4f658c commit 2c7c3ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/confusing-number-ii.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def validCountInLessLength(n): # count unconfused numbers in the pattern of [01
3131
total = len(centers)
3232
for i in xrange(1, len(s), 2): # count unconfused numbers for each odd length less than s
3333
if i == 1:
34-
valid += len(lookup)-len(centers)
34+
valid += len({k for k in centers.iterkeys() if k != '0'})
3535
else:
3636
valid += total * (len(lookup)-1)
3737
total *= len(lookup)

0 commit comments

Comments
 (0)