Class Solution
-
- All Implemented Interfaces:
public final class Solution1316 - Distinct Echo Substrings.
Hard
Return the number of distinct non-empty substrings of
textthat can be written as the concatenation of some string with itself (i.e. it can be written asa + awhereais some string).Example 1:
Input: text = "abcabcabc"
Output: 3
Explanation: The 3 substrings are "abcabc", "bcabca" and "cabcab".
Example 2:
Input: text = "leetcodeleetcode"
Output: 2
Explanation: The 2 substrings are "ee" and "leetcodeleetcode".
Constraints:
1 <= text.length <= 2000texthas only lowercase English letters.
-
-
Constructor Summary
Constructors Constructor Description Solution()
-
Method Summary
Modifier and Type Method Description final IntegerdistinctEchoSubstrings(String text)-
-
Method Detail
-
distinctEchoSubstrings
final Integer distinctEchoSubstrings(String text)
-
-
-
-