Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 37de384

Browse files
refactor 395
1 parent 1cf3721 commit 37de384

File tree

1 file changed

+3
-28
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+3
-28
lines changed

src/main/java/com/fishercoder/solutions/_395.java

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,10 @@
11
package com.fishercoder.solutions;
22

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-
303
public class _395 {
314
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+
*/
338
public int longestSubstring(String s, int k) {
349
return findLongestSubstring(s.toCharArray(), 0, s.length(), k);
3510
}

0 commit comments

Comments
 (0)