#include<bits/stdc++.h>
using namespace std;
int main()
{
int t, i;
cin >> t;
while(t--)
{
string s, b;
cin >> s;
int c = 0;
b = "";
for(i=0;i<s.size();i++)
{
c++;
if(s[i] != s[i+1])
{
b.push_back(s[i]);
string p = to_string(c);
b = b + p;
c = 0;
}
}
if(c > 0)
{
b.push_back(s[i-1]);
string p = to_string(c);
b = b + p;
c = 0;
}
if(s.size() > b.size())
{
cout << "YES" << "\n";
}
else
cout << "NO" << "\n";
}
return 0;
}
using namespace std;
int main()
{
int t, i;
cin >> t;
while(t--)
{
string s, b;
cin >> s;
int c = 0;
b = "";
for(i=0;i<s.size();i++)
{
c++;
if(s[i] != s[i+1])
{
b.push_back(s[i]);
string p = to_string(c);
b = b + p;
c = 0;
}
}
if(c > 0)
{
b.push_back(s[i-1]);
string p = to_string(c);
b = b + p;
c = 0;
}
if(s.size() > b.size())
{
cout << "YES" << "\n";
}
else
cout << "NO" << "\n";
}
return 0;
}
Comments
Post a Comment