Skip to content

LC 1832 [E] Check if the Sentence Is Pangram

Code with Senpai edited this page Jun 5, 2022 · 1 revision
class Solution:
    def checkIfPangram(self, sentence: str) -> bool:
        alphabet = Counter(string.ascii_lowercase)

        for c in sentence:
            if c in alphabet:
                alphabet[c] -= 1
                
        for v in alphabet.values():
            if v == 1:
                return False
            
        return True
        
    def checkIfPangram(self, s):
        return len(set(s)) == 26
Clone this wiki locally