Python (Simple Sliding Window)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def countCompleteSubstrings(self, word, k):\n        wd = set(word)\n\n        if len(wd) == 1:\n            if len(word) >= k:\n                return len(word)-k+1\n            else:\n                return 0 \n\n        def bfs(left,right):\n            for i in range(left+1,right+1):\n                if abs(ord(word[i])-ord(word[i-1])) > 2:\n                    return False \n            return True \n\n        def dfs(word,width):\n            n, left, result, dict1 = len(word), 0, 0, defaultdict(int)\n\n            for right in range(n):\n                dict1[word[right]] += 1 \n\n                if right-left+1 > width:\n                    dict1[word[left]] -= 1 \n\n                    if dict1[word[left]] == 0:\n                        del dict1[word[left]]\n\n                    left += 1 \n\n                if right-left+1 == width and all([val == k for val in dict1.values()]):\n                    if bfs(left,right):\n                        result += 1 \n\n            return result \n\n        total = 0 \n\n        for i in range(1,len(wd)+1):\n            total += dfs(word,i*k)\n\n        return total \n```
['Python3']