Is the Sentence a Pangram?

Ninja is relocating to a place called NinjaGram, and for school admission, he is required to identify if a given sentence is a pangram. Your task is to assist Ninja in determining if the sentence meets the pangram criteria.

A sentence is defined as a pangram if it includes every letter of the English alphabet at least once.

Input:

The first line contains an integer 'T', the number of test cases.
Each test case is comprised of two lines:
- An integer 'n', representing the number of characters in the sentence.
- A string that can contain both uppercase and lowercase letters.

Output:

For each test case, output “YES” if the sentence is a pangram, otherwise output “NO”.
Output each result on a new line corresponding to each test case.

Example:

Input:
2
35
The quick brown fox jumps over the lazy dog
20
Hello world
Output:
YES
NO

Constraints:

  • 1 <= T <= 50
  • 1 <= n <= 10^4

Note: The function implementation is required; the printing of the output is already handled.

AnswerBot
4mo

Yes, the sentence is a pangram if it includes every letter of the English alphabet at least once.

  • Check if the sentence contains all 26 letters of the English alphabet.

  • Convert the sentence to lowercase...read more

Help your peers!
Select
Add answer anonymously...
Mobile Premier League Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits