You are viewing a single comment's thread. Return to all comments →
public static String pangrams(String s) { boolean[] alphabet = new boolean[26]; for (int i = 0; i < s.length(); i++) { if (s.charAt(i) >= 'a' && s.charAt(i) <= 'z') { System.out.println(s.charAt(i) - 'a'); alphabet[(s.charAt(i) - 'a')] = true; } else if (s.charAt(i) >= 'A' && s.charAt(i) <= 'Z') { alphabet[s.charAt(i) - 'A'] = true; } } for (int i = 0; i < alphabet.length; i++) { if (!alphabet[i]) { return "not pangram"; } } return "pangram"; }
Seems like cookies are disabled on this browser, please enable them to open this website
Pangrams
You are viewing a single comment's thread. Return to all comments →