1832. Check if the Sentence Is Pangram
题目
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:
1 | Input: sentence = "thequickbrownfoxjumpsoverthelazydog" |
Example 2:
1 | Input: sentence = "leetcode" |
Constraints:
1 <= sentence.length <= 1000
sentence consists of lowercase English letters.
解题思路
这题是让我们判断字符串是不是pangram,是返回true否返回false
pangram的定义:
26个小写字母字符串中都有,那么这个字符串就是pangram字符串
代码
Python
1 | class Solution: |
C++
1 | class Solution { |
Go
1 | func checkIfPangram(sentence string) bool { |
评论
