forked from VibhutiJindal/CodeChef
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check
51 lines (38 loc) · 844 Bytes
/
check
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <stdio.h>
#include <iostream>
#include<string>
using namespace std;
int main()
{
//printf("Hello World");
int t=0;
cin>>t;
while(t--)
{
string s;
string s1 ;
cin>>s;
int l=s.length();
for(int i=0;i<l;i++)
{
int count =0;
while(s[i]==s[i+1])
{
i++;
count++;
}
//cout<<s[i]<<count+1;
string c=to_string(count+1);
s1 = s1 + s[i] + c ;
}
//cout<<l<<endl;
//cout<<s1<<" ";
int l1= s1.length();
//cout<<l1;
if(l>l1)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
return 0;
}