[Python3] freq table
\n\nclass Solution:\n    def maxFreq(self, s: str, maxLetters: int, minSize: int, maxSize: int) -> int:\n        freq = {}\n        temp = {}\n        for i in 
\n```\nclass Solution:\n    def maxFreq(self, s: str, maxLetters: int, minSize: int, maxSize: int) -> int:\n        freq = {}\n        temp = {}\n        for i in range(len(s)): \n            temp[s[i]] =  1 + temp.get(s[i], 0)\n            if i >= minSize: \n                temp[s[i-minSize]] -= 1 \n                if temp[s[i-minSize]] == 0: temp.pop(s[i-minSize])\n            \n            if i >= minSize-1 and len(temp) <= maxLetters: \n                key = s[i-minSize+1: i+1]\n                freq[key] = 1 + freq.get(key, 0)\n        return max(freq.values(), default=0)\n```
['Python3']