LeetCode 솔루션 분류
[10/17] 1832. Check if the Sentence Is Pangram
본문
Easy
109126Add to ListShareA 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.
Example 2:
Input: sentence = "leetcode" Output: false
Constraints:
1 <= sentence.length <= 1000
sentence
consists of lowercase English letters.
Accepted
112,833
Submissions
138,921
관련자료
-
링크
댓글 1
학부유학생님의 댓글
- 익명
- 작성일
Runtime: 54 ms, faster than 57.41% of Python3 online submissions for Check if the Sentence Is Pangram.
Memory Usage: 13.8 MB, less than 54.73% of Python3 online submissions for Check if the Sentence Is Pangram.
Memory Usage: 13.8 MB, less than 54.73% of Python3 online submissions for Check if the Sentence Is Pangram.
class Solution:
def checkIfPangram(self, sentence: str) -> bool:
return len(set(sentence)) == 26