easy +8 pts

Is pangram

Check if a sentence uses every letter of the alphabet at least once.

A pangram is a sentence that contains every letter of the English alphabet at least once. For example, "The quick brown fox jumps over the lazy dog" is a pangram. Write a function `is_pangram(s: str) -> bool` that returns `True` if the input string `s` is a pangram, and `False` otherwise. The check should be case-insensitive and ignore characters that are not letters (digits, spaces, punctuation, etc.). The input may contain uppercase and lowercase letters, digits, spaces, and punctuation. An empty string is not a pangram. The function should handle strings of any length (0 to 10^5 characters).

Constraints

0 ≤ len(s) ≤ 10^5. Only printable ASCII characters appear. Time complexity O(n), space O(1) (or O(26)).

Example

>>> is_pangram("The quick brown fox jumps over the lazy dog")
True
>>> is_pangram("Hello World")
False
>>> is_pangram("abcdefghijklmnopqrstuvwxyz")
True
>>> is_pangram("")
False
8 points ~12 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Think about using a set to track which letters have been seen.
Convert the string to lowercase and filter to only 'a'–'z'.
Check if the size of the seen set equals 26.
You can use `set("abcdefghijklmnopqrstuvwxyz")` as a reference.
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.