C++ Sliding Window + Hashing
You will find a substring occuring the maximum number of times when it is of the minimum length .\nSo out of all substrings of lenght \'minLength\' find the mos
You will find a substring occuring the maximum number of times when it is of the minimum length .\nSo out of all substrings of lenght \'minLength\' find the most frequent substring \n```\nclass Solution {\npublic:    \n    int uniqueCount(string &str){\n        set<char> st;        \n        for(char c: str){                            \n            st.insert(c);        \n        }\n        return st.size() ;\n    }    \n  \n    int maxFreq(string &s, int maxUnique , int minLength, int maxLength) {\n        int n = s.length();\n        if(n<minLength)\n            return 0; \n        unordered_map<string,int> mp;\n        int ans = 0 ;\n        for(int i=0;i+minLength<=n;i++){\n            string sub = s.substr(i,minLength); \n            if(uniqueCount(sub)<=maxUnique) \n                mp[sub]++; \n            ans = max(ans , mp[sub]); \n        }\n        return ans; \n    }\n};\n```
['C', 'C++']