|| ||Code Submission Evaluation System
CSES Problem Set
Task | Statistics
CSES - RepetitionsCSES - Repetitions
|Time limit:||1.00 s
||Memory limit:||512 MB|
You are given a DNA sequence: a string that consists of characters A, C, G, and T. Your task is to find the longest repetition in the sequence. This is a maximum-length substring where each character is the same.
The only input line contains a string of $n$ characters.
Print one integer: the length of the longest repetition.