-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPangram.cpp
More file actions
57 lines (50 loc) · 1.31 KB
/
Copy pathPangram.cpp
File metadata and controls
57 lines (50 loc) · 1.31 KB
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
52
53
54
55
56
57
/*Pangram
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
A word or a sentence in some language is called a pangram if all the characters of the alphabet of this language appear in it at least once. Pangrams are often used to demonstrate fonts in printing or test the output devices.
You are given a string consisting of lowercase and uppercase Latin letters. Check whether this string is a pangram. We say that the string contains a letter of the Latin alphabet if this letter occurs in the string in uppercase or lowercase.
Input
The first line contains a single integer n (1 ≤ n ≤ 100) — the number of characters in the string.
The second line contains the string. The string consists only of uppercase and lowercase Latin letters.
Output
Output "YES", if the string is a pangram and "NO" otherwise.
Examples
inputCopy
12
toosmallword
outputCopy
NO
inputCopy
35
TheQuickBrownFoxJumpsOverTheLazyDog
outputCopy
YES
*/
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,sum=0;
cin>>n;
string st1;
cin>>st1;
list<char>a;
for(int i=0;i<n;i++){
st1[i]=tolower(st1[i]);
}
for(int j=0;j<n;j++){
a.push_back(st1[j]);
}
a.sort();
a.unique();
int size=a.size();
int b=26;
if(size==b){
cout<<"YES";
}
else{
cout<<"NO";
}
return 0;
}