Skip to content

Commit c9f909b

Browse files
authored
Update binary-string-with-substrings-representing-1-to-n.py
1 parent 76598c1 commit c9f909b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/binary-string-with-substrings-representing-1-to-n.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ def queryString(self, S, N):
99
:rtype: bool
1010
"""
1111
# since S with length n has at most different n-k+1 k-digit numbers
12-
# => given S with length n, N is at most 2(n-k+1)
13-
# => N <= 2(n-k+1) < 2n = 2 * S.length
12+
# => given S with length n, valid N is at most 2(n-k+1)
13+
# => valid N <= 2(n-k+1) < 2n = 2 * S.length
1414
return all(bin(i)[2:] in S for i in reversed(xrange(N//2, N+1)))

0 commit comments

Comments
 (0)