File tree 1 file changed +3
-28
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +3
-28
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 395. Longest Substring with At Least K Repeating Characters
5
- *
6
- * Find the length of the longest substring T of a given string
7
- * (consists of lowercase letters only)
8
- * such that every character in T appears no less than k times.
9
-
10
- Example 1:
11
- Input:
12
- s = "aaabb", k = 3
13
-
14
- Output:
15
- 3
16
-
17
- The longest substring is "aaa", as 'a' is repeated 3 times.
18
-
19
-
20
- Example 2:
21
- Input:
22
- s = "ababbc", k = 2
23
-
24
- Output:
25
- 5
26
-
27
- The longest substring is "ababb", as 'a' is repeated 2 times and 'b' is repeated 3 times.
28
- */
29
-
30
3
public class _395 {
31
4
public static class Solution1 {
32
- /**Reference: https://discuss.leetcode.com/topic/57372/java-divide-and-conquer-recursion-solution*/
5
+ /**
6
+ * Reference: https://discuss.leetcode.com/topic/57372/java-divide-and-conquer-recursion-solution
7
+ */
33
8
public int longestSubstring (String s , int k ) {
34
9
return findLongestSubstring (s .toCharArray (), 0 , s .length (), k );
35
10
}
You can’t perform that action at this time.
0 commit comments