python easy approach
\nclass Solution:\n    def maxFreq(self, s: str, maxLetters: int, minSize: int, maxSize: int) -> int:\n        s1 = []\n        count ={}\n        while minSize
```\nclass Solution:\n    def maxFreq(self, s: str, maxLetters: int, minSize: int, maxSize: int) -> int:\n        s1 = []\n        count ={}\n        while minSize <= maxSize:\n            for i in range(0,len(s)):\n                if (i+ minSize) <=len(s) and len(set(s[i: i+ minSize])) <= maxLetters:\n                    s1.append(s[i: i+ minSize])\n            minSize += 1         \n        for i in s1:\n            count[i] = count[i] + 1 if i in count  else 1      \n        return max(count.values()) if count else 0\n```\nPlease do upvote if you like this solution
['Sliding Window', 'Python', 'Python3']