[Python] O(n) simple solution using counter.
python\n def maxFreq(self, s: str, maxLetters: int, minSize: int, maxSize: int) -> int:\n        # count frequency of characters\n        count = collections.Co
```python\n def maxFreq(self, s: str, maxLetters: int, minSize: int, maxSize: int) -> int:\n        # count frequency of characters\n        count = collections.Counter()\n        \n        # Check only for minSize\n        for i in range(len(s) - minSize + 1):\n            t = s[i : i+minSize]\n            if len(set(t)) <= maxLetters:\n                count[t] += 1\n        \n        return max(count.values()) if count else 0\n\t\t\n```
['Python', 'Python3']