Check whether a lowercase string contains every letter of the alphabet

Quick Overview

Decide whether a string of lowercase letters contains every letter of the English alphabet at least once. The problem tests tracking seen characters with a set or a bitmask, and why a distinct-count check works only when the input holds nothing but letters.

Check whether a lowercase string contains every letter of the alphabet

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Other

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 and `False` otherwise. ### Function Signature ```python def check_if_pangram(sentence: str) -> bool: ... ``` ### Constraints - `1 <= len(sentence) <= 1000` - `sentence` consists of lowercase English letters. ### Examples ```text Input: sentence = "thequickbrownfoxjumpsoverthelazydog" Output: True ``` The sentence contains each of the 26 letters from 'a' to 'z' at least once, so it is a pangram. ```text Input: sentence = "interview" Output: False ``` The sentence uses only the letters 'i', 'n', 't', 'e', 'r', 'v' and 'w', so many letters (such as 'a', 'b' and 'c') are missing. ```text Input: sentence = "abcdefghijklmnopqrstuvwxy" Output: False ``` The sentence has 25 distinct letters and is missing only 'z', which is enough to make it not a pangram.

Overview: Decide whether a string of lowercase letters contains every letter of the English alphabet at least once. The problem tests tracking seen characters with a set or a bitmask, and why a distinct-count check works only when the input holds nothing but letters.

Nov 25, 2026
easySoftware EngineerOtherCoding & Algorithms
0
0

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 and False otherwise.

Function Signature

def check_if_pangram(sentence: str) -> bool:
    ...

Constraints

  • 1 <= len(sentence) <= 1000
  • sentence consists of lowercase English letters.

Examples

Input: sentence = "thequickbrownfoxjumpsoverthelazydog"
Output: True

The sentence contains each of the 26 letters from 'a' to 'z' at least once, so it is a pangram.

Input: sentence = "interview"
Output: False

The sentence uses only the letters 'i', 'n', 't', 'e', 'r', 'v' and 'w', so many letters (such as 'a', 'b' and 'c') are missing.

Input: sentence = "abcdefghijklmnopqrstuvwxy"
Output: False

The sentence has 25 distinct letters and is missing only 'z', which is enough to make it not a pangram.