Search⌘ K
AI Features

Maximum Number of Occurrences of a Substring

Try to solve the Maximum Number of Occurrences of a Substring problem.

We'll cover the following...

Statement

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:

  • ...