Skip to content

Commit 1a75467

Browse files
committed
Added 1650A - Deletions of Two Adjacent Letters.cpp
1 parent 0d4e40b commit 1a75467

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
5+
#define ll long long
6+
#define pb push_back
7+
#define ff first
8+
#define ss second
9+
#define mp make_pair
10+
11+
// Code Written By: Vikash Patel
12+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
13+
string solve(string s, char c)
14+
{
15+
int n = s.size();
16+
for(int i=0; i<n; i++)
17+
{
18+
if(s[i] == c && i%2 == 0)
19+
return "YES";
20+
}
21+
return "NO";
22+
}
23+
int main()
24+
{
25+
ios_base::sync_with_stdio(0);
26+
cin.tie(0);
27+
cout.tie(0);
28+
29+
// #ifndef ONLINE_JUDGE
30+
// freopen("input.txt", "r", stdin);
31+
// freopen("/Users/vikash/Desktop/output.txt", "w", stdout);
32+
// #endif
33+
34+
int t;
35+
cin>>t;
36+
while(t--)
37+
{
38+
string s;
39+
cin>>s;
40+
char c;
41+
cin>>c;
42+
cout<<solve(s, c)<<endl;
43+
}
44+
return 0;
45+
}

0 commit comments

Comments
 (0)