Python Sliding Window
\nclass Solution(object):\n    def maxFreq(self, s, maxLetters, minSize, maxSize):\n\n        begin, end = 0, 0\n        curr = collections.defaultdict(int)\n  
```\nclass Solution(object):\n    def maxFreq(self, s, maxLetters, minSize, maxSize):\n\n        begin, end = 0, 0\n        curr = collections.defaultdict(int)\n        res = collections.defaultdict(int)\n        while end < len(s):\n            curr[s[end]] += 1\n            end += 1\n\n            while minSize <= (end - begin) <= maxSize:\n                if len(curr) <= maxLetters:\n                    res[s[begin:end]] += 1\n                    \n                curr[s[begin]] -= 1\n                if curr[s[begin]] == 0:\n                    del curr[s[begin]]\n                begin += 1\n        \n\n        return max(res.values()) if res else 0\n                \n```
['Python']