freqMap
to store the frequency of substrings and a hashmap charCount
to store the count of characters within the current window.start
and end
to represent the sliding window.end
pointer.charCount
and increment its count.minSize
, remove the character at start
from charCount
and increment start
.minSize
and the number of unique characters in charCount
is less than or equal to maxLetters
, add the substring to freqMap
and increment its count.freqMap
and return it.