Please solve the programming task below using a self-contained code snippet in a markdown code block.

Given a binary string s and an integer k, return true if every binary code of length k is a substring of s. Otherwise, return false.
 
Please complete the following python code precisely:
```python
class Solution:
    def hasAllCodes(self, s: str, k: int) -> bool:
```