sliding window + map (beginner friendly)
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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\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    {\n        int n = s.size();\n        int ans = 0;\n        int i=0, j=0;\n\n        string temp;\n\n        unordered_map<char,int> m;\n        // to count the freq of substrings that satisfies the condn\n        unordered_map<string, int> substr;\n\n        while(j < n)\n        {\n            m[s[j]]++;\n\n            temp=temp+s[j];\n\n            while(m.size()>maxLetters || temp.size()>minSize)\n            {\n                m[s[i]]--;\n                if(m[s[i]] == 0)\n                    m.erase(s[i]);\n\n                temp.erase(temp.begin()+0);\n                i++;\n            }\n            if(m.size()<=maxLetters && temp.size()==minSize)\n            {\n                substr[temp]++;\n            }\n            j++;\n        }\n\n        for(auto it : substr)\n        {\n            ans = max(ans, it.second);\n        }\n        return ans;\n    }\n};\n```
['Hash Table', 'Two Pointers', 'Sliding Window', 'C++']