

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?
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.
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
2
12
toosmallword
35
TheQuickBrownFoxJumpsOverTheLazyDog
NO
YES
In the first test case, the given string is “toosmallword” which contains the characters [‘t’,’o’,’s’,’m’,’a’,’l’,’w’,’r’,’d’], which doesn’t contain all the 26 alphabetic characters. Hence the answer is “NO”.
In the second test case, the given string is “TheQuickBrownFoxJumpsOverTheLazyDog” which contains the characters: [‘t’,’h’,’e’,’q’,’u’,’i’,’c’,’k’,’b’,’r’,’o’,’w’,’n’,’f’,’x’,’j’,’m’,’p,’’s’,’v’,’l,’a’,’z’,’y’,’ d’,’g’], which contains all the 26 alphabetic characters. Hence the answer is “YES”.
Sample Input 2:
2
16
CodingNinjas
10
CodeStudio
NO
NO
In the first test case, the given string is “CodingNinjas” which contains the characters [‘c’,’o’,’d’,’i’,’n’,’g’,’i’,’j’,’a’,’s’], which doesn’t contain all the 26 alphabetic characters. Hence the answer is “NO”.
In the first test case, the given string is “CodeStudio” which contains the characters [‘c’,’o’,’d’,’e’,’s’,’t’,’u’,’i’], which doesn’t contain all the 26 alphabetic characters. Hence the answer is “NO”.
Will it be feasible to maintain a boolean array to check for each character in the string?
The idea is to maintain a boolean array that will check for all the characters in the string.
The steps are as follows:
O(N), where N is the number of characters in the string.
We are traversing a loop only once and checking if all the 26 characters are present in the string. Hence, the overall time complexity is O(N).
O(1), no extra space required.
As we are not using any extra space except for an array to maintain 26 characters. Hence, the overall space complexity is O(1).