| English | 简体中文 |
Given a string
s and an integer
k, return the length of the longest substring of
s such that the frequency of each character in this substring is greater than or equal to
Input: s = "aaabb", k = 3 Output: 3 Explanation: The longest substring is "aaa", as 'a' is repeated 3 times.
Input: s = "ababbc", k = 2 Output: 5 Explanation: The longest substring is "ababb", as 'a' is repeated 2 times and 'b' is repeated 3 times.
1 <= s.length <= 104
sconsists of only lowercase English letters.
1 <= k <= 105