File tree Expand file tree Collapse file tree 1 file changed +0
-32
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +0
-32
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 424. Longest Repeating Character Replacement
5
- *
6
- * Given a string that consists of only uppercase English letters,
7
- * you can replace any letter in the string with another letter at most k times.
8
- * Find the length of a longest substring containing all repeating letters you can get after performing the above operations.
9
-
10
- Note:
11
- Both the string's length and k will not exceed 104.
12
-
13
- Example 1:
14
-
15
- Input:
16
- s = "ABAB", k = 2
17
-
18
- Output:
19
- 4
20
-
21
- Explanation:
22
- Replace the two 'A's with two 'B's or vice versa.
23
- Example 2:
24
-
25
- Input:
26
- s = "AABABBA", k = 1
27
-
28
- Output:
29
- 4
30
-
31
- Explanation:
32
- Replace the one 'A' in the middle with 'B' and form "AABBBBA".
33
- The substring "BBBB" has the longest repeating letters, which is 4.
34
- */
35
3
public class _424 {
36
4
37
5
public static class Solution1 {
You can’t perform that action at this time.
0 commit comments