longest substring containing '1'
Submissions: 8881   Accuracy:

42.38%

  Difficulty: Basic   Marks: 1

Given a function that takes a binary string. The task is to return the longest size of contiguous substring containing only ‘1’.

Input:
The first line of input contains an integer T denoting the no of test cases.Then T test cases follow. Each test case contains a string S.

Output:
For each test case return the maximum length of required sub string.

Constraints: 
1<=T<=100
1<=|string length|<=104

Example:
Input:

2
110
11101110

Output:
2
3

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Arun Tyagi, Saksham Raj Seth
Author: arun03


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.