You are viewing a single comment's thread. Return to all comments →
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"; }
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 →
MY CPP EASY SOL