We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Scanner sc = new Scanner(System.in);
String s= sc.nextLine();
s = s.toLowerCase();
HashSet<Integer> h = new HashSet<Integer>();
for (int i = 0; i < s.length(); i++) {
if(s.charAt(i)!=' '){
int put = (int)s.charAt(i);
h.add(put);
}
}
if(h.size()==26)
System.out.println("pangram");
else
System.out.println("not pangram");
Pangrams
You are viewing a single comment's thread. Return to all comments →
Java simple code..