Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit37de384

Browse files
refactor 395
1 parent1cf3721 commit37de384

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
packagecom.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
publicclass_395 {
314
publicstaticclassSolution1 {
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
publicintlongestSubstring(Strings,intk) {
349
returnfindLongestSubstring(s.toCharArray(),0,s.length(),k);
3510
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp