1832. Check if the Sentence Is Pangram LeetCode Solution
In this guide, you will get 1832. Check if the Sentence Is Pangram LeetCode Solution with the best time and space complexity. The solution to Check if the Sentence Is Pangram problem is provided in various programming languages like C++, Java, and Python. This will be helpful for you if you are preparing for placements, hackathons, interviews, or practice purposes. The solutions provided here are very easy to follow and include detailed explanations.
Table of Contents
- Problem Statement
- Complexity Analysis
- Check if the Sentence Is Pangram solution in C++
- Check if the Sentence Is Pangram solution in Java
- Check if the Sentence Is Pangram solution in Python
- Additional Resources

Problem Statement of 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:
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.
Complexity Analysis
- Time Complexity: O(n)
- Space Complexity: O(26) = O(1)
1832. Check if the Sentence Is Pangram LeetCode Solution in C++
class Solution {
public:
bool checkIfPangram(string sentence) {
return unordered_set(sentence.begin(), sentence.end()).size() == 26;
}
};
/* code provided by PROGIEZ */
1832. Check if the Sentence Is Pangram LeetCode Solution in Java
class Solution {
public boolean checkIfPangram(String sentence) {
Set<Character> seen = new HashSet<>();
for (final char c : sentence.toCharArray())
seen.add(c);
return seen.size() == 26;
}
}
// code provided by PROGIEZ
1832. Check if the Sentence Is Pangram LeetCode Solution in Python
class Solution:
def checkIfPangram(self, sentence: str) -> bool:
return len(set(sentence)) == 26
# code by PROGIEZ
Additional Resources
- Explore all LeetCode problem solutions at Progiez here
- Explore all problems on LeetCode website here
Happy Coding! Keep following PROGIEZ for more updates and solutions.