easy +8 pts

Is pangram?

Check whether a sentence contains every letter of the alphabet.

Write a function `is_pangram(s: str) -> bool` that returns `True` if the given string `s` is a pangram, meaning it contains every letter of the English alphabet (`a` through `z`) at least once. The check must ignore letter case (both uppercase and lowercase count) and all characters that are not alphabetic (such as spaces, digits, punctuation). The function should return `False` for empty strings or strings that miss any alphabet letter. **Function signature:** `def is_pangram(s: str) -> bool:` **Examples:** - `is_pangram("The quick brown fox jumps over the lazy dog")` returns `True`. - `is_pangram("Hello world")` returns `False` because many letters are missing.

Constraints

- `0 <= len(s) <= 10^5` - String contains printable ASCII characters. - Time complexity O(n), space complexity 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("Pack my box with five dozen liquor jugs")
True
8 points ~10 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Convert the string to lowercase first.
Use a set to collect only alphabetic characters.
Compare the size of the set with 26.
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.