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

Commit 33a2bb7

Browse files
refactor 1297
1 parent bea7a4d commit 33a2bb7

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

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

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,6 @@
55
import java.util.Map;
66
import java.util.Set;
77

8-
/**
9-
* 1297. Maximum Number of Occurrences of a Substring
10-
*
11-
* Given a string s, return the maximum number of ocurrences of any substring under the following rules:
12-
*
13-
* The number of unique characters in the substring must be less than or equal to maxLetters.
14-
* The substring size must be between minSize and maxSize inclusive.
15-
*
16-
* Example 1:
17-
* Input: s = "aababcaab", maxLetters = 2, minSize = 3, maxSize = 4
18-
* Output: 2
19-
* Explanation: Substring "aab" has 2 ocurrences in the original string.
20-
* It satisfies the conditions, 2 unique letters and size 3 (between minSize and maxSize).
21-
*
22-
* Example 2:
23-
* Input: s = "aaaa", maxLetters = 1, minSize = 3, maxSize = 3
24-
* Output: 2
25-
* Explanation: Substring "aaa" occur 2 times in the string. It can overlap.
26-
*
27-
* Example 3:
28-
* Input: s = "aabcabcab", maxLetters = 2, minSize = 2, maxSize = 3
29-
* Output: 3
30-
*
31-
* Example 4:
32-
* Input: s = "abcde", maxLetters = 2, minSize = 3, maxSize = 3
33-
* Output: 0
34-
*
35-
* Constraints:
36-
* 1 <= s.length <= 10^5
37-
* 1 <= maxLetters <= 26
38-
* 1 <= minSize <= maxSize <= min(26, s.length)
39-
* s only contains lowercase English letters.
40-
* */
418
public class _1297 {
429
public static class Solution1 {
4310
public int maxFreq(String s, int maxLetters, int minSize, int maxSize) {

0 commit comments

Comments
 (0)