




Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
The brute force solution is to check every substring, which would TLE. How can we improve this solution?
In an equal count substring, the first character appears count times, the second character appears count times, and so on.
The length of an equal count substring is the number of unique characters multiplied by count.
The length of all equal count substrings are multiples of count.