BETA

Difficulty Level: Easy

Submissions: 6469 Accuracy:

27.65%

1[0]1 Pattern Count
       

Given a string, your task is to find the number of patterns of form 1[0]1 where [0] represents any number of zeroes (minimum requirement is one 0) there should not be any other character except 0 in the [0] sequence.

 

Input:
The first line contains T denoting the number of testcases. Then follows description of testcases. Each case contains a string.

 

Output:
For each test case, output the number of patterns.

 

Constraints:
1<=T<=20
1<=Length of String<=2000


Example:
Input:
2

100001abc101
1001ab010abc01001

 

Output:
2
2

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

Contributor: Amit Khandelwal

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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