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

Most View Post

Recent post

Codeforces Round 925 (Div. 3) 1931D. Divisible Pairs Solution

    Problem Link  :   https://codeforces.com/contest/1931/problem/D S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. ...

Powered by Blogger.