https://codeforces.com/problemset/problem/1466/C
思路: 长度大于等于四的回文由小回文构成,消除小回文就没有大回文了
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
int n;
cin>>n;
while(n--){
int ans=0;
string s;
cin>>s;
for(int i=0;i<s.size();i++){
if(s[i]=='*') continue;/~!!!!
if(i+2<s.size()&&s[i]==s[i+2]){
ans++;
s[i+2]='*';
}
if(i+1<s.size()&&s[i]==s[i+1]){
s[i+1]='*';
ans++;
}
}
cout<<ans<<'\n';
}
return 0;
}