求此题解题思想和代码
题目描述You're given a string of lower-case Latin letters. Your task is to find the length of its longest substring that can be met in the string at least twice. These occurrences can overlap (see sample test 2).
输入描述
The first input line contains the string. It's guaranteed, that the string is non-empty, consists of lower-case Latin letters, and its length doesn't exceed 100.
输出描述
Output one number — length of the longest substring that can be met in the string at least twice.
样例输入
abcd
ababa
zzz
样例输出
0
3
2