#C9887. Max Consecutive Digit Occurrences

    ID: 54029 Type: Default 1000ms 256MiB

Max Consecutive Digit Occurrences

Max Consecutive Digit Occurrences

You are given a string composed of digits. For each test case, your task is to determine the maximum number of consecutive occurrences of any digit in the provided string.

More formally, given a string S of digits, find the maximum length L such that there exists an index i where all characters from S[i] to S[i+L-1] are the same. In mathematical notation, if we denote the string by \(S = s_1s_2\ldots s_n\), you need to compute:

[ \max_{1 \leq i \leq n} { \text{length of consecutive identical characters starting at } s_i } ]

Input will consist of multiple test cases. For each test case, output the result in a separate line.

inputFormat

The first line of the input contains an integer \(T\) denoting the number of test cases. Each of the following \(T\) lines contains a non-empty string consisting only of digits.

outputFormat

For each test case, output a single integer in a new line representing the maximum number of consecutive occurrences of any digit in the corresponding input string.

## sample
1
1234567890
1

</p>