#C6809. Maximum Contiguous Active Routers
Maximum Contiguous Active Routers
Maximum Contiguous Active Routers
You are given several test cases. In each test case, a string representing the state of routers is provided. Each character of the string is either '1' (indicating an active router) or '0' (indicating an inactive router). Your task is to determine the maximum number of contiguous active routers in each test case.
For example, in the string 1101100111
, the maximum contiguous sequence of active routers is 111
which has a length of 3.
Formally, for each test case string s, find the maximum value of k such that there exists an index i for which
$$s_i = s_{i+1} = \cdots = s_{i+k-1} = 1$$
with all indices being valid.
inputFormat
The first line of input contains a single integer T indicating the number of test cases.
Each of the following T lines contains a non-empty string consisting only of characters '0' and '1', representing the state of the routers for that test case.
Input is read from standard input (stdin).
outputFormat
For each test case, output a single integer representing the maximum number of contiguous active routers (i.e. consecutive '1's) in that test case.
Each output should be printed on its own line to standard output (stdout).
## sample3
1101100111
001100
11111
3
2
5
</p>