File tree 1 file changed +0
-29
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +0
-29
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 1062. Longest Repeating Substring
5
- *
6
- * Given a string S, find out the length of the longest repeating substring(s). Return 0 if no repeating substring exists.
7
- *
8
- * Example 1:
9
- * Input: "abcd"
10
- * Output: 0
11
- * Explanation: There is no repeating substring.
12
- *
13
- * Example 2:
14
- * Input: "abbaba"
15
- * Output: 2
16
- * Explanation: The longest repeating substrings are "ab" and "ba", each of which occurs twice.
17
- *
18
- * Example 3:
19
- * Input: "aabcaabdaab"
20
- * Output: 3
21
- * Explanation: The longest repeating substring is "aab", which occurs 3 times.
22
- *
23
- * Example 4:
24
- * Input: "aaaaa"
25
- * Output: 4
26
- * Explanation: The longest repeating substring is "aaaa", which occurs twice.
27
- *
28
- * Note:
29
- * The string S consists of only lowercase English letters from 'a' - 'z'.
30
- * 1 <= S.length <= 1500
31
- * */
32
3
public class _1062 {
33
4
public static class Solution1 {
34
5
public int longestRepeatingSubstring (String S ) {
You can’t perform that action at this time.
0 commit comments