Alice just tries to maintain a string, with a kind of operation and a kind of query.
The kind of operation allows to insert a character at the end of the string.
The kind of query considers the substring, denoted by $T$, of the string from the $l$-th character to the $r$-th one, and asks the maximum length of substring of $T$ which appears at least twice in $T$.
If no substring appears at least twice in $T$, the outcome should be $0$.