forked from rajatgoyal715/Hackerrank
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPangrams.java
More file actions
29 lines (26 loc) · 807 Bytes
/
Pangrams.java
File metadata and controls
29 lines (26 loc) · 807 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
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s1 = sc.nextLine();
String s = s1.toLowerCase();
int flag=0;
int l = s.length();
char word[] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
for(int i=0;i<26;i++){
flag=0;
for(int j=0;j<l;j++){
if(s.charAt(j)==word[i]){
flag = 1;
break;
}
}
if(flag==0)
break;
}
if(flag==1)
System.out.println("pangram");
else
System.out.println("not pangram");
}
}