Check if the Sentence Is Pangram

A pangram is a sentence in which every letter of the English alphabet appears at least once. Given a string `sentence` containing only lowercase English letters, return true if `sentence` is a pangram, or false otherwise.

30:00

Check if the Sentence Is Pangram
easy
Free written solution
Topics
Companies

A pangram is a sentence in which every letter of the English alphabet appears at least once. Given a string sentence containing only lowercase English letters, return true if sentence is a pangram, or false otherwise.

Example 1:
Input: {"sentence":"thequickbrownfoxjumpsoverthelazydog"}
Output: true
Constraints:
  • 1 <= sentence.length <= 1000

  • sentence consists of lowercase English letters.

Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result

Run code to see results.

Input
arr ={"sentence":"thequickbrownfoxjumpsoverthelazydog"}

Use a 26-bit mask as the alphabet checklist: bit k turns on once letter k has appeared. All 26 bits on means a pangram.

sentence

read 0/35

t
h
e
q
u
i
c
k
b
r
o
w
n
f
o
x
j
u
m
p
s
o
v
e
r
t
h
e
l
a
z
y
d
o
g

teal = first time that letter appeared

alphabet checklist (bit k = letter k)

0/26

a

0

b

0

c

0

d

0

e

0

f

0

g

0

h

0

i

0

j

0

k

0

l

0

m

0

n

0

o

0

p

0

q

0

r

0

s

0

t

0

u

0

v

0

w

0

x

0

y

0

z

0

Variables
VariableValue
seen0
letters0
DepthFunction Call
Stack empty
0/37