Skip to content

Commit

Permalink
[C++] Add solution to Quick Brown Fox
Browse files Browse the repository at this point in the history
  • Loading branch information
ejrcarr committed Feb 24, 2024
1 parent c131676 commit 62a6076
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Solutions/Quick Brown Fox/quickbrownfox.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <iostream>
#include <string>

using namespace std;

int main() {
int n;
cin >> n;
while(n--) {
int freq[26] = { 0 };
string input;
getline(cin >> ws, input);
for(char letter : input) {
if(!isalpha(letter)) continue;
freq[tolower(letter) - 'a']++;
}
string missing = "";
for(int i = 0; i < 26; ++i) {
if (freq[i] == 0) {
missing += 'a' + i;
}
}
if(missing != "") cout << "missing " << missing << "\n";
else cout << "pangram" << "\n";
}
return 0;
}

0 comments on commit 62a6076

Please sign in to comment.