All Tracks Data Structures Hash Tables Basics of Hash Tables Problem

LongLong
/

Binary Search, Hash Maps, String Manipulation

Problem
Editorial
Analytics

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

SAMPLE INPUT
abacaba
SAMPLE OUTPUT
3
Time Limit: 2.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB

Best Submission

Similar Problems

Contributors

This Problem was Asked in

Initializing Code Editor...
Notifications
View All Notifications

?