1[0]1 Pattern Count
Submissions: 13622   Accuracy:

37.26%

  Difficulty: Easy   Marks: 2

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
Author: Amit Khandelwal 1


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.