Leetcode 1297. Maximum Number of Occurrences of a Substring
Find the substring (overlaps allowed) that occurs most often in s among those with length between minSize and maxSize and at most maxLetters distinct characters, and return its occurrence count.
Asked at:
Chewy
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Mid August, 2026
Senior
Given a string s, return the maximum number of occurrences of any substring under the following rules: The number of unique characters in the substring must be less than or equal to maxLetters. The substring size must be between minSize and maxSize inclusive.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.