89. Every Letter Present

A sign painter wants to test a new stencil set that contains one stencil for each letter of the English alphabet. To check a candidate phrase, she needs to know whether painting it would use every one of the 26 letters at least once.

Given the string s, return true if every letter from a to z occurs in s at least once, and false otherwise. Letters are case-insensitive, so A and a count as the same letter. Digits, spaces and punctuation may appear in s but they never count toward the 26 letters.

Example 1

Input:
s = "amazingly few discotheques provide jukeboxes"
Output:
true
Explanation:

All 26 letters appear somewhere in the phrase, so the answer is true.

Example 2

Input:
s = "good morning, hello world 123"
Output:
false
Explanation:

Letters such as a, b and c never appear, so the answer is false.

Constraints

1 ≤ s.length ≤ 105

s consists of printable ASCII characters (letters, digits, spaces and punctuation).

How this problem is judged

Answers
Your answer must match exactly. Numbers compare by value, so 2 and 2.0 are equal.

Expected complexity

Time
O(n)
Space
O(1)

What the author was aiming for. Your own solution is not measured against it.

Asked in an interview

Were you asked this in an interview? Say where, anonymously.

Code
Loading the editor…