-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPangram.java
More file actions
34 lines (30 loc) · 1022 Bytes
/
Pangram.java
File metadata and controls
34 lines (30 loc) · 1022 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
28
29
30
31
32
33
34
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* Created by MalhotR1 on 12/29/2017.
*/
public class Pangram {
public static void main(String[] args) throws IOException {
try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
int length = Integer.parseInt(br.readLine().trim());
if (length < 26) {
System.out.println("NO");
return;
}
int[] alpha = new int[26];
char[] in = br.readLine().trim().toLowerCase().toCharArray();
// if (in.length < 26) System.out.println("NO");
for (int i = 0; i < in.length; i++) {
alpha[in[i] - 97]++;
}
for (int i = 0; i < alpha.length; i++) {
if (alpha[i] <= 0) {
System.out.println("NO");
return;
}
}
System.out.println("YES");
}
}
}