Problem:
A pangram is a sentence where every letter of the English alphabet appears at least once.
Given a string sentence containing only lowercase English letters, return true if sentence is a pangram, or false otherwise.
Example 1:
Input: sentence = "thequickbrownfoxjumpsoverthelazydog"
Output: true
Explanation: sentence contains at least one of every letter of the English alphabet.
Solution:
Just extract different letters from string, and check whether the number of letters is larger than 26.
My Code:
class Solution:
def checkIfPangram(self, sentence: str) -> bool:
return len(set(sentence))>=26
Use set to get unique values, then check the length.