aboutsummaryrefslogtreecommitdiff
path: root/other/check_pangram_sentence.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'other/check_pangram_sentence.cpp')
-rw-r--r--other/check_pangram_sentence.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/other/check_pangram_sentence.cpp b/other/check_pangram_sentence.cpp
new file mode 100644
index 0000000..67f1af2
--- /dev/null
+++ b/other/check_pangram_sentence.cpp
@@ -0,0 +1,19 @@
+#include "leetcode.h"
+
+class Solution {
+public:
+ bool checkIfPangram(string sentence) {
+ set<int> s;
+ for (auto &i : sentence)
+ s.insert(i);
+ return s.size() == 26;
+ }
+};
+
+int main() {
+ Solution obj;
+ if (obj.checkIfPangram("thequickbrownfoxjumpsoverthelazydog"))
+ cout << "true";
+ else
+ cout << "false";
+}