B
meda
c_cpp
a year ago
644 B
16
Indexable
#include<bits/stdc++.h>
#define ll long long
#define endl "\n"
using namespace std;
template<class T>
void printff(vector<T>& v) {
for (auto k : v) cout << k << " ";
cout << endl;
}
void SOLVE() {
string s; cin >> s;
int n = s.length();
for(int i = 0; i < n - 1; i++){
if(s[i] == s[i + 1]) return void(cout << "yes" << endl);
}
for(int i = 0 ; i < n - 2; i++){
if(s[i] == s[i + 2]) return void(cout << "yes" << endl);
}
cout << "no" << endl;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int tc = 1; cin >> tc;
while(tc--) SOLVE();
return 0;
}Editor is loading...
Leave a Comment