We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22b0803 commit b9a2fd4Copy full SHA for b9a2fd4
Codeshef/CHEFCHR.cpp
@@ -0,0 +1,26 @@
1
+#include <bits/stdc++.h>
2
+using namespace std;
3
+
4
+int main() {
5
+ int T;
6
+ cin>>T;
7
+ while(T--){
8
+ string str;
9
+ cin>>str;
10
+ int nums[26],count=0;
11
+ for(int i=0;i<26;i++)nums[i]=0;
12
13
+ int len=str.length();
14
+ for(int i=0;i<(len-3);i++){
15
+ for(int j=i;j<(i+4);j++){
16
+ nums[str[j]-'a']++;
17
+ }
18
+ if(nums[2]==1 && nums[4]==1 && nums[5]==1 && nums[7]==1)count++;
19
20
21
22
+ if(count>0)cout<<"lovely "<<count<<endl;
23
+ else cout<<"normal"<<endl;
24
25
+ return 0;
26
+}
0 commit comments