-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPangram.java
More file actions
27 lines (27 loc) · 758 Bytes
/
Pangram.java
File metadata and controls
27 lines (27 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Pangram {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
String s = scanner.next();
if (n < 26) {
System.out.println("NO");
return;
}
s = s.toLowerCase();
Set<Character> uniqueChars = new HashSet<>();
for (int i = 0; i < n; i++) {
char c = s.charAt(i);
if (c >= 'a' && c <= 'z') {
uniqueChars.add(c);
}
}
if (uniqueChars.size() == 26) {
System.out.println("YES");
} else {
System.out.println("NO");
}
}
}