Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Check out the constraints, (maxSize <=26).
This means you can explore all substrings in O(n * 26).
Find the Maximum Number of Occurrences of a Substring with bruteforce.