Check if a String Contains all Binary Codes of Size K - Leetcode 1461 - Python