We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6fcc570 commit 4c6d443Copy full SHA for 4c6d443
is_pangram/is_pangram.cpp
@@ -0,0 +1,32 @@
1
+#include <iostream>
2
+#include <vector>
3
+using namespace std;
4
+
5
+bool is_pangram(string str) {
6
7
+ vector<bool> pangram(26, false);
8
9
+ for (int i = 0; i < str.length(); i++) {
10
+ if (str[i] >= 'A' && str[i] <= 'Z')
11
+ pangram[str[i] - 'A'] = true;
12
+ if (str[i] >= 'a' && str[i] <= 'z')
13
+ pangram[str[i] - 'a'] = true;
14
+ }
15
16
+ for (int i = 0; i < 26; i++)
17
+ if (!pangram[i])
18
+ return false;
19
20
+ return true;
21
+}
22
23
+int main() {
24
25
+ bool pangram = is_pangram("The quick brown fox jumps over the lazy dog");
26
+ if (pangram)
27
+ cout << "Given string is a pangram" << endl;
28
+ else
29
+ cout << "Given string is not a pangram" << endl;
30
31
+ return 0;
32
0 commit comments