Skip to content

Commit 4813778

Browse files
committed
Added 1367A - Short Substrings.cpp
1 parent dcbd30c commit 4813778

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

1367A - Short Substrings.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
#define ll long long
5+
6+
// Code Written By: Vikash Patel
7+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8+
9+
int main()
10+
{
11+
int t;
12+
cin>>t;
13+
while(t--)
14+
{
15+
string a,b;
16+
cin>>b;
17+
a += b[0];
18+
for(int i=1;i<b.size()-1;)
19+
{
20+
if(b[i]==b[i+1])
21+
{
22+
a += b[i];
23+
i+=2;
24+
}
25+
}
26+
a += b[b.size()-1];
27+
cout<<a<<endl;
28+
}
29+
return 0;
30+
}

0 commit comments

Comments
 (0)