Codeforces Round #776 (Div. 3) 1650A - Deletions of Two Adjacent Letters Solution
Problem Link:https://codeforces.com/problemset/problem/1650/B
Solution in C++:
///La ilaha illellahu muhammadur rasulullah
///******Bismillahir-Rahmanir-Rahim******///
///Abul Hasnat Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long n,l,i,f,t;
cin>>t;
while(t--)
{
string s,s1;
f=0;
cin>>s>>s1;
for(i=0;i<s.size();i++)
{
if((s[i]==s1[0])&&(i%2==0))
{
f=1;
break;
}
}
if(f==1)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
}
No comments