2
public int maxFreq(String s, int maxLetters, int minSize, int maxSize) {3
Map<String, Integer> count = new HashMap<>();7
for (int i = 0; i + minSize - 1 < n; i++) {8
String y = s.substring(i, i + minSize);9
count.put(y, count.getOrDefault(y, 0) + 1);11
int unique = uniqueCharactersInString(y);12
if (unique <= maxLetters) {13
ans = Math.max(ans, count.get(y));16
// System.out.println(count);20
int uniqueCharactersInString(String y) {21
Set<Character> hs = new HashSet<>();22
for (int j = 0; j < y.length(); j++) hs.add(y.charAt(j));