LongLong
Practice
4.1 (62 votes)
Approved
Binary search
Hash maps
Medium
Open
String manipulation
Problem
81% Success 5629 Attempts 30 Points 2s Time Limit 256MB Memory 1024 KB Max Code

You are given a string S. Find the length of its the longest substring which occurs at least two times. Occurences can intersect.

Input
One line containing a string S consisting of lowercase Latin letters.

Output
Output one integer - answer to the question.

Constraints
1 <= length of S <= 1000000

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
11 votes
Tags:
AlgorithmsApprovedMathMediumOpen
Points:30
17 votes
Tags:
SortingHashmapImplementationHash TablesData StructuresBasics of Hash TablesHashingMathObservation
Points:30
88 votes
Tags:
ApprovedBinary SearchMediumOpenSorting