-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSETSPROBLEMS.cpp
92 lines (65 loc) · 1.48 KB
/
SETSPROBLEMS.cpp
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#include<iostream>
#include<set>
#include<vector>
#include<cctype>
#include<algorithm>
using namespace std;
bool checkAllAlphabets(string &s) {
if(s.length()<26){
return false;
}
transform(s.begin(),s.end(),s.begin(),::tolower);
set<char> alphabets;
for(auto it:s){
alphabets.insert(it);
}
return (alphabets.size()==26);
}
int main() {
string name = "abcdefghIjKlMNOPQRSTUVWxyz";
// getline(cin,name);
if(checkAllAlphabets(name)){
cout<<"String has all alphabets";
} else{
cout<<"String not has all alphabets";
}
return 0;
}
// ................Sum of two vectors of common elements..........
// int main() {
// int n,m;
// cin>>n>>m;
// vector<int>vec1(n);
// vector<int>vec2(m);
// for(int i=0;i<n;i++){
// cin>>vec1[i];
// }
// for(int i=0;i<m;i++){
// cin>>vec2[i];
// }
// set<int>sets;
// for(int i=0;i<n;i++){
// sets.insert(vec1[i]);
// }
// int sum = 0;
// for(int i=0;i<m;i++){
// if(sets.find(vec2[i])!=sets.end()){
// sum+=vec2[i];
// }
// }
// cout<<sum<<endl;
// }
// Input names in set and print unique names.........
// int main(){
// set<string>set_name;
// int n;
// cin>>n;
// while(n--){
// string i;
// cin>>i;
// set_name.insert(i);
// }
// for(auto it:set_name){
// cout<<it<<" ";
// }cout<<endl;
// }