Leetcode Practice
LC 1832. Check if the Sentence is Pangram
- Last updated
- Reading time
- 1 min read
The problem
Solution
Here is another set problem. Since there is a contstraint that only lowercase alphabetical characters are included, the length of a pangram as a set should be 26. If the sentence as a set is smaller, return false.
function checkIfPangram(sentence: string): boolean {
return new Set(sentence).size === 26
}