JavaScript, easy to understand, only need to check minSize
A key part of this question is to realize that you only need to check the substrings of minSize. Every substring of maxSize wil have a substring of minSize cont
A key part of this question is to realize that you only need to check the substrings of minSize. Every substring of maxSize wil have a substring of minSize contained within it. Therefore it is possible to find all substring combinations by only looping through once. Use a set to find all unique characters in a substring, and ```set.size``` will then tell you how many unique characters. \n\n```\nvar maxFreq = function(s, maxLetters, minSize, maxSize) {\n    \n    let ht = {}\n    let max = 0\n    \n    for(let i=0; i<=s.length - minSize; i++){\n        \n        let sub = s.substring(i, i+ minSize)\n        \n        let tempSet = new Set(sub)\n        \n        if(tempSet.size <= maxLetters){\n            if(ht.hasOwnProperty(sub)){\n                ht[sub] += 1\n            }else{\n                ht[sub] = 1\n            }\n            if(ht[sub] > max ){\n                max = ht[sub]\n            }    \n        }       \n    }\n    \n    return max    \n};\n```
['JavaScript']