Skip to content

Commit e652c5f

Browse files
authored
Create check-if-the-sentence-is-pangram.cpp
1 parent 62d21cc commit e652c5f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Time: O(n)
2+
// Space: O(26) = O(1)
3+
4+
class Solution {
5+
public:
6+
bool checkIfPangram(string sentence) {
7+
return size(unordered_set<int>(cbegin(sentence), cend(sentence))) == 26;
8+
}
9+
};

0 commit comments

Comments
 (0)