Back to problems Sign in to unlock
Leetcode
Easy
Strings
Sets
Check If The Sentence Is Pangram
Determine whether a sentence contains every letter of the English alphabet at least once.
Acceptance 0%
Problem Statement
Problem
Given a sentence consisting of lowercase English letters and spaces, determine whether it is a pangram.
A pangram is a sentence that contains every letter from a to z at least once.
Return true if the sentence is a pangram, otherwise return false.
Notes
- Ignore spaces.
- Letter case is not a concern in the standard version of this problem, since the input is typically lowercase.
- A letter only needs to appear once to count toward the pangram condition.
Input Format
- A single string
sentence. - The string contains lowercase English letters and may contain spaces.
Output Format
- Return a boolean value:
trueifsentenceis a pangramfalseotherwise
Constraints
1 <= sentence.length <= 1000in the typical LeetCode version.sentencecontains only lowercase English letters and spaces.
Examples
Sample cases returned by the problem API.
Example 1
Input
sentence = "thequickbrownfoxjumpsoverthelazydog"
Output
true
Explanation
This sentence contains every letter from a to z at least once.
Example 2
Input
sentence = "leetcode"
Output
false
Explanation
Several letters of the alphabet do not appear in the sentence.
Premium problem context
Unlock deeper context for this problem
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.
Guided hints
Editorial and discussion links
Concept map and variants
Track your progress
Sign in to bookmark this problem, save notes, and manage its revision plan.