#K82407. Longest Contiguous Ones
Longest Contiguous Ones
Longest Contiguous Ones
You are given a number of binary strings. For each binary string, your task is to determine the length of the longest contiguous subsequence of '1's. Formally, for a given string \(S\) of length \(n\), find the maximum \(k\) such that there exists an index \(i\) (with \(1 \leq i \leq n-k+1\)) where \(S[i] = S[i+1] = \dots = S[i+k-1] = '1'\). This problem tests your ability to process strings and count consecutive elements.
Note: The input should be read from standard input and the output should be sent to standard output.
inputFormat
The first line of input contains an integer \(T\) denoting the number of test cases. Each of the following \(T\) lines contains a single binary string \(S\).
Input Format:
T S1 S2 ... ST
outputFormat
For each test case, output a single line containing one integer: the length of the longest contiguous sequence of '1's in the corresponding binary string.
## sample1
110011100
3