forked from alexprut/HackerRank
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Solution.java
34 lines (30 loc) · 863 Bytes
/
Solution.java
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.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String args[] ) throws Exception {
Scanner sc = new Scanner(System.in);
int cache[] = new int[26];
String s = sc.nextLine();
for (int i = 0; i < s.length(); i++) {
int tmp = (int) s.charAt(i);
if (65 <= tmp && tmp <= 90) {
tmp += 32;
}
if (97 <= tmp && tmp <= 122) {
cache[tmp - 97]++;
}
}
boolean pangram = true;
for (int i = 0; i < 26; i++) {
if (cache[i] == 0) { pangram = false; }
}
if (pangram) {
System.out.println("pangram");
} else {
System.out.println("not pangram");
}
}
}