-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPangram.cpp
More file actions
38 lines (38 loc) · 716 Bytes
/
Pangram.cpp
File metadata and controls
38 lines (38 loc) · 716 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
35
36
37
38
//Pangram Checker
#include<bits/stdc++.h>
using namespace std;
int main()
{
vector <int> v;
int sum=0,length=0;
int n;
cin>>n;
char str[1000];
cin>>str;
if(n<26)
cout<<"NO"<<endl;
else
{
for(int i=0;str[i]!='\0';i++)
{
int a= (int) str[i];
if(a>=65 && a<=90)
{
a=32+a;
}
v.push_back(a);
length++;
}
sort(v.begin(),v.end());
for(auto i=0;i<length;i++)
{
if(v[i]!=v[i+1])
{
sum=sum+v[i];
}
}
if(sum==2847) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
return 0;
}