Skip to content

Commit

Permalink
Create 1461-check-if-a-string-contains-all-binary-codes-of-size-k.py
Browse files Browse the repository at this point in the history
  • Loading branch information
younessZMZ committed Mar 30, 2023
1 parent 48dfc74 commit 7406285
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Solution:
def hasAllCodes(self, s: str, k: int) -> bool:
return len(set(s[i : i + k] for i in range(len(s) - k + 1))) == 2**k

0 comments on commit 7406285

Please sign in to comment.