You are viewing a single comment's thread. Return to all comments →
Fastest Solution:
#include <iostream> using namespace std; bool is_pangram(const string& str) { int mask = 0; for(const char c : str) { if(islower(c)) mask |= 1 << (c - 'a'); else if(isupper(c)) mask |= 1 << (c - 'A'); } return mask == (1 << 26) - 1; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string str; getline(cin, str); cout << (is_pangram(str)? "pangram" : "not pangram") << endl; return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Pangrams
You are viewing a single comment's thread. Return to all comments →
Fastest Solution: