For this Question: Given a string S and a pattern P both of lowercase characters. The task is to check if the given pattern P exists in the given string S or not.First line of input contains number of testcases T. For each testcase, first line will the string and second line will be the pattern to be searched.

Constraints:
1 <= T <= 100
1 <= |S|, |P| <= 1000For each testcase, print "Yes" if pattern exists or "No" if doesn't.Input:
2
aabaacaadaabaaabaa
aaba
aabaacaadaabaaabaa
ccda

Output:
Yes
No

Explanation:
Testcase 1: Given pattern aaba is found in the string at index 0.
Testcase 2: Given pattern ccda doesn't exists in the string at all., I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#include <iostream>
#include<stack>
using namespace std;
void getZarr(string str, int Z[])
{
    int n = str.length();
    int L, R, k;

    L = R = 0;
    for (int i = 1; i < n; ++i)
    {
        if (i > R)
        {
            L = R = i;
            while (R<n && str[R-L] == str[R])
                R++;
            Z[i] = R-L;
            R--;
        }
        else
        {
            k = i-L;

            if (Z[k] < R-i+1)
                Z[i] = Z[k];

            else
            {
                L = i;
                while (R<n && str[R-L] == str[R])
                    R++;
                Z[i] = R-L;
                R--;
            }
        }
    }
}

void search(string text, string pattern)
{
    // Create concatenated string "P$T"
    string concat = pattern + "$" + text;
    int l = concat.length();

    int Z[l];
    getZarr(concat, Z);

    for (int i = 0; i < l; ++i)
    {
        if (Z[i] == pattern.length())
            {cout <<"Yes" << endl;return ;}
    }
    cout<<"No"<<endl;
}


int main(){

int t;
cin>>t;
while(t--){
    string t;
    string p;
    cin>>t>>p;
      search(t, p);


}

}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?