This the code I have been using but it is working for strings which are not pangram but not the other way. Also for the strings which have duplicate.
int i;
char l,ch;
String s="";
Scanner sc= new Scanner(System.in);
s=sc.next();
s=s.trim();
int c=0;
s=s.toLowerCase();
for (l='a';l<='z';l++) {
for(i=0;i<s.length();i++) {
ch=s.charAt(i);
if(ch==l) {
c++;
}
}
if(c==0)
break;
else {
c=0;
continue;
}
}
if(l=='z')
System.out.println("pangram");
else
System.out.println("not pangram");