Admission in Ninja Gram
Ninja is shifting to a new place named NinjaGram. To take admission to the new school, the teacher gives him a sentence and asks him to check whether the sentence is a pangram.
A word or a sentence is called a pangram if it contains all the English alphabet letters.
Since Ninja is new to programming, he doesn’t have much experience; he asks you to solve the problem. Can you help Ninja figure out whether the sentence is a pangram?
Input Format:
The first line of input contains an integer ‘T’ denoting the number of test cases. The test cases follow.
The first line of each test case contains a number ‘n’ denoting the number of characters in the string.
The second line of each test case contains the string where the string characters can be both uppercase and lowercase.
Output Format:
For each test case, if Ninja managed to solve the problem, print “YES” else “NO”.
Print the output of each test case in a separate line.
Note:
You are not required to print the expected output; it has already been taken care of. Just implement the function.
Constraints:
1<= T <= 50
1<= n <= 10^4
Where ’T’ is the number of test cases, ‘n’ denotes the number of characters in the string.
Time Limit: 1 sec
CodingNinjas
author
2y
Step 1 : I have used hashing concept to map occurrence of english alphabet.
Step 2 : I used Counter array with size 26 to find count of every alphabet.
Step 3 : Traverse the array and if it's panagram ...read more
CodingNinjas
author
2y
Brute Force
The idea is to maintain a boolean array that will check for all the characters in the string.
The steps are as follows:
- We will maintain a boolean visited array of size 26 and initialized wi...read more
Help your peers!
Add answer anonymously...
Popular interview questions of Software Developer
>
Mobile Premier League Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app