-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathpangrams.java
More file actions
40 lines (34 loc) · 764 Bytes
/
pangrams.java
File metadata and controls
40 lines (34 loc) · 764 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
35
36
37
38
39
40
//eg--we promptly judged antique ivory buckles for the next prize
import java.util.*;
public class pangrams
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
LinkedList<String> list=new LinkedList<String>();
String s=sc.nextLine().toUpperCase();
HashSet<String> set = new HashSet<String>();
for(int i=65;i<=90;i++)
{
list.add(Character.toString((char)i));
}
for(int i=0;i<s.length();i++)
{
set.add(Character.toString(s.charAt(i)));
}
//System.out.println(set);
try{
Iterator itr=set.iterator();
while(itr.hasNext())
list.remove(itr.next());
}
catch(Exception e)
{}
finally
{
if(list.size()==0)
System.out.println("Pangram");
else
System.out.println("Not Pangram");
}
}
}