[JAVA] Easy one siding window: No need to consider MaxSize
Basically, you don\'t need to care about the maxSize. Because if the answer is a qualified String with a length of maxSize, it is substring with a length of min
Basically, you don\'t need to care about the maxSize. Because if the answer is a qualified String with a length of maxSize, it is substring with a length of minSize should also be a candidate. \n```\n    public int maxFreq(String ss, int maxLetters, int minSize, int maxSize) {\n        char[] s = ss.toCharArray();\n        int[] dict = new int[26];\n        int uniqChar = 0;\n        Map<String, Integer> count = new HashMap<>();\n        for (int i = 0, j = 0; j < s.length; j++) {\n            dict[s[j] - \'a\']++;\n            if (dict[s[j] - \'a\'] == 1) {\n                uniqChar++;\n            }\n            if (j >= minSize - 1) {\n                if (uniqChar <= maxLetters) {\n                    count.put(ss.substring(i, j + 1), count.getOrDefault(ss.substring(i, j + 1), 0) + 1);\n                }\n                dict[s[i] - \'a\']--;\n                if (dict[s[i] - \'a\'] == 0) {\n                    uniqChar--;\n                }\n                i++;\n            }\n        }\n        return count.isEmpty() ? 0 : Collections.max(count.values());\n    }\n```
['Sliding Window']