Sliding Window Solution| C++ Easy Approach
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(2N)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int maxFreq(string s, int maxLetters, int minSize, int maxSize) {\n        int i = 0, j = 0, k = maxLetters, sz = s.size(), maxmO = 0, cnt = 0 ;\n        unordered_map<char, int> umap ; unordered_map<string, int> umap_2 ;\n        \n        while(j<sz)\n        {\n            umap[s[j]]++ ; \n            \n            while(j-i+1 > minSize || umap.size()>k)\n            {\n                umap[s[i]]-- ; \n                if(umap[s[i]] == 0){umap.erase(s[i]) ;} \n                i++ ; \n            }\n            \n            if(j-i+1 == minSize && j-i+1 <= maxSize && umap.size()<=k)\n            {\n                 maxmO = max(maxmO, ++umap_2[s.substr(i, minSize)]) ;\n            }\n            j++ ;\n        }\n        return maxmO ;\n    }\n};\n```
['C++']