Preparando MOJI

You're Given a String...

2000ms 262144K

Description:

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).

Input:

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:

Output one number — length of the longest substring that can be met in the string at least twice.

Sample Input:

abcd

Sample Output:

0

Sample Input:

ababa

Sample Output:

3

Sample Input:

zzz

Sample Output:

2

Informação

Codeforces

Provedor Codeforces

Código CF23A

Tags

brute forcegreedy

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 08:27:15

Relacionados

Nada ainda