Using substring
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \nThe only thing is you h
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nThe only thing is you have to know that maxsize is useless. \njust do simple brute force .\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 {\n    public int maxFreq(String s, int max, int min, int maxSize) {\n       int  ans=0;\n       HashMap<String,Integer>map=new HashMap<>();\n       for(int i=0;i<s.length()-min+1;i++){\n           String sub= s.substring(i,i+min);\n           if(right(sub,max)){\n             map.put(sub,map.getOrDefault(sub,0)+1);\n               ans=Math.max(ans,map.get(sub));\n           }\n       }\n       return ans;\n    }\n    private boolean right(String s ,int max){\n        Set<Character>set=new HashSet<>();\n        for(int i=0;i<s.length();i++){\n            set.add(s.charAt(i));\n            if(set.size()>max){\n                return false;\n            }\n        }\n        return true;\n    }\n}\n```
['Hash Table', 'String', 'Java']