Classic problem #1832EasyHash TableString
Check if the Sentence Is Pangram
Real-world version: Does the Notice Use Every LetterTracked in this browser only
Read Check if the Sentence Is Pangram on LeetCode(opens in a new tab)
The statement here is our own: the same inputs, outputs and technique.
A notice is given as the string notice, written in lowercase English letters and nothing else.
Return whether the notice uses every one of the twenty-six letters at least once.
Examples
Example 1
- Input
- notice = "packmyboxwithfivedozenliquorjugs"
- Output
- true
Every letter of the alphabet turns up somewhere in the notice, several of them more than once, which is allowed.
Example 2
- Input
- notice = "abcdefghijklmnopqrstuvwxy"
- Output
- false
The notice runs from the first letter to the twenty-fifth and stops, so the last letter never appears.
Example 3
- Input
- notice = "hello"
- Output
- false
Far too short to hold all twenty-six letters, and it uses only four different ones.
Constraints
- 1 <= notice.length <= 1000
- notice consists of lowercase English letters only.
The signature
The editor starts with this. It matches the parent problem's shape, so a solution that works here works on a standard judge unchanged.
Python
def check_if_pangram(notice: str) -> bool:Java
public boolean checkIfPangram(String notice)Checking your plan…
How this problem was checked
- Passed: Reference solution run against 15 test cases: 15 passed
- Passed: 3 worked examples confirmed by running the code
- Passed: 0 eight-word sequences shared with the parent problem's text
- Passed: Agrees with an independent brute-force solution on random inputs
- Passed: Test set shown to catch deliberately broken solutions
- Passed: Reviewed by a separate quality pass
- Passed: Function arity matches the parent problem's