What would be the best logic to check all the letters in a given string.
If all the 26 letters are available in the provided string, I want to check that and perform
Try this one out it's easy and simple to understand
import java.util.*;
public class Pnagram{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
String Str=sc.nextLine();
Set set = new HashSet();
for(char c:Str.toUpperCase().toCharArray()){
if(Character.isLetter(c))
set.add(c);
}
if(set.size()==26)
System.out.println("pnagram");
else
System.out.println("not pnagram");
}
}