• + 0 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; 
    }