문제
A pangram contains every English letter at least once. Determine whether the text is a pangram. Ignore case, spaces, digits, and punctuation.
Implement pangram_check(text).
Input
text: The text to inspect.
Output
Return true if all 26 letters appear, otherwise false.
제약 조건
0 ≤ text length ≤ 100,000. Input contains printable ASCII characters. Only letters A–Z and a–z count.
예시
입력:
text = "The quick brown fox jumps over the lazy dog."
예상 출력:
expected = True
입력:
std::string text = "The quick brown fox jumps over the lazy dog.";
예상 출력:
bool expected = true;
입력:
string text = "The quick brown fox jumps over the lazy dog.";
예상 출력:
bool expected = true;
설명
Every letter from a through z appears at least once. Capital T counts as t.
입력:
text = "abcdefghijklmnopqrstuvwxy"
예상 출력:
expected = False
입력:
std::string text = "abcdefghijklmnopqrstuvwxy";
예상 출력:
bool expected = false;
입력:
string text = "abcdefghijklmnopqrstuvwxy";
예상 출력:
bool expected = false;
설명
This text contains a through y, but it has no z. One missing letter makes it false.
접근 방법
먼저 스스로 풀어 본 뒤 힌트를 하나씩 열어 보세요.
힌트 1
Normalize the text so letter case does not matter.
힌트 2
Track which of the 26 letters have appeared at least once.
힌트 3
Ignore every non-letter character completely, including spaces and punctuation.
예상 복잡도
O(n) time, O(1) extra space
참고 자료
이 문제는 CodeUtility에 맞게 수정되었습니다. 위의 설명과 제한 조건을 따르세요.