Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
568 B
0
Indexable
Never
#include <iostream>
#include <bits/stdc++.h>


using namespace std;

int main()
{
    int n;
    cin>>n;
    for(int i = 0; i<n; i++){
        string a, b;
        cin>>a>>b;
        int a_i = 0, b_i = 0;
        while(a_i<a.size() and b_i<b.size()){
            if(a[a_i]==b[b_i]){
                a_i++;
                b_i++;
            }
            else{
                b_i++;
            }
        }
        if(a_i==a.size()){
            cout<<"DA"<<endl;
        }
        else{
            cout<<"NE"<<endl;
        }
    }
}
Leave a Comment