MohamedAbdel3al

A. Pangram

Sep 6th, 2021
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. int n ; cin >> n ;
  2. if (n < 27) cout << "NO" ;
  3. else {
  4. string s ; cin >> s ;
  5. transform(s.begin() , s.end() , s.begin(),::tolower);
  6. cout << s << "\n" ;
  7. int freq[n + 1] ;
  8. for (int i = 0; i < s.size(); i++) freq[s[i] - 'a']++ ;
  9. bool valid = true ;
  10. for (int i = 0; i < n + 1; i++)
  11. if (freq[i] == 0) valid = false ;
  12. cout << (valid ? "YES" : "NO") ;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment