• + 0 comments

    MY CPP EASY SOL

    string pangrams(string s) {
        vector<int>alphabetCnt(26,0);
        for(int i=0;i<s.size();i++){
            if(s[i]!=' '&&islower(s[i]))
            alphabetCnt[(int)s[i]-97]++;
            else if(s[i]!=' '&&isupper(s[i]))
            alphabetCnt[(int)s[i]-65]++;
        }
        for(int i=0;i<26;i++){
            if(alphabetCnt[i]==0)
            return "not pangram";
        }
        return "pangram";
    }