1[0]1 Pattern Count
PROBLEM : 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 -------------------------------------------------------------------------------- SIMPLE c++ IMPLEMENTATION : -------------------------------------------------------------------------------- #include<iostream> using namespace std; #include<string.h> int PatternCount(string ) ; int main() { int t ; string str ; cin>>t ; while(t--){ cin>>str ; cout<<Pattern...