Given a string s and integers maxLetters, minSize, and maxSize, consider all substrings of s whose length is between minSize and maxSize inclusive. A substring is valid if it contains at most maxLetters distinct characters.
Return the maximum number of times any valid substring occurs in s.
Note: Occurrences of a substring may overlap.
Constraints:
s.length
maxLetters
minSize maxSize
s consists of only lowercase English letters.
Given a string s and integers maxLetters, minSize, and maxSize, consider all substrings of s whose length is between minSize and maxSize inclusive. A substring is valid if it contains at most maxLetters distinct characters.
Return the maximum number of times any valid substring occurs in s.
Note: Occurrences of a substring may overlap.
Constraints:
s.length
maxLetters
minSize maxSize
s consists of only lowercase English letters.