一个普通程序员.
© 2022. All rights reserved.
AC!
python3
class Solution: def hasAllCodes(self, s: str, k: int) -> bool: m = set() for i in range(len(s)-k+1): m.add(s[i:i+k]) return len(m) == (1 << k)