// A string is a pangram if it contains all the characters of the alphabet ignoring case
#include <iostream>
bool isStringPangram(std::string str) {
int letters[26] = { 0 };
int size = str.length();
for (int i = 0; i < size; i++) {
if (isupper(str[i])) {
letters[ str[i] - 'A' ]++;
}
else if (islower(str[i])) {
letters[ str[i] - 'a' ]++;
}
}
for (int i = 0; i < 26; i++) {
if(letters[i] == 0)
return false;
}
return true;
}
int main()
{
std::string str = "The quick brown fox jumps over the lazy dog";
if (isStringPangram(str) == true)
std::cout << "string is a Pangram";
else
std::cout << "string is not a Pangram";
}
/*
run:
string is a Pangram
*/