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```python3 []\nclass Solution:\n    def numberOfSubstrings(self, s, k):\n        n, left, count, dict1 = len(s), 0, 0, defaultdict(int)\n\n        for right in range(n):\n            dict1[s[right]] += 1 \n\n            while dict1[s[right]] >= k:\n                dict1[s[left]] -= 1 \n\n                if dict1[s[left]] == 0:\n                    del dict1[s[left]]\n\n                left += 1 \n\n            count += right - left + 1 \n\n        return n*(n+1)//2 - count \n```
['Python3']