Class Solution
-
- All Implemented Interfaces:
public final class Solution395 - Longest Substring with At Least K Repeating Characters\.
Medium
Given a string
sand an integerk, return the length of the longest substring ofssuch that the frequency of each character in this substring is greater than or equal tok.Example 1:
Input: s = "aaabb", k = 3
Output: 3
Explanation: The longest substring is "aaa", as 'a' is repeated 3 times.
Example 2:
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.
Constraints:
<code>1 <= s.length <= 10<sup>4</sup></code>
sconsists of only lowercase English letters.<code>1 <= k <= 10<sup>5</sup></code>
-
-
Constructor Summary
Constructors Constructor Description Solution()
-
Method Summary
Modifier and Type Method Description final IntegerlongestSubstring(String s, Integer k)-
-
Method Detail
-
longestSubstring
final Integer longestSubstring(String s, Integer k)
-
-
-
-