-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCHEFING.cpp
More file actions
34 lines (31 loc) · 702 Bytes
/
Copy pathCHEFING.cpp
File metadata and controls
34 lines (31 loc) · 702 Bytes
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
#include <bits/stdc++.h>
int main(void) {
int T;
std::cin >> T;
int N;
char c;
while(T--) {
std::cin >> N;
int N1 = N;
int table[N][26] = {0};
while(N--) {
char s[201] = {0};
std::scanf("%s", s);
int i = 0;
while(s[i]) {
table[N][s[i] - 97] = 1;
i++;
}
}
int count = 0;
for (int i=0; i< 26; i++) {
int count1 = 0;
for (int j=0; j<N1; j++) {
count1 += table[j][i];
}
if (count1 >= N1)
count++;
}
std::cout << count << std::endl;
}
}