Python3 Using Counter 6 lines
I didn\'t use the variable maxSize. If there is a solution with size  larger than minSize, there must be a solution with size exactly minSize as well.\n\nclass 
I didn\'t use the variable `maxSize`. If there is a solution with size  larger than `minSize`, there must be a solution with size exactly `minSize` as well.\n```\nclass Solution:\n    def maxFreq(self, s: str, maxLetters: int, minSize: int, maxSize: int) -> int:\n        count = collections.Counter()\n        for i in range(minSize-1, len(s)):\n            chars = set(s[i-minSize+1:i+1])\n            if len(chars) > maxLetters: continue\n            count[s[i-minSize+1:i+1]] += 1\n        return max(count.values() or [0])\n```
[]