You are viewing a single comment's thread. Return to all comments →
Java solution:
public static String pangrams(String s) { // Write your code here String alpha = "abcdefghijklmnopqrstuvwxyz"; Set<Character> alphaSet = alpha.chars() .mapToObj(c -> (char)c) .collect(Collectors.toSet()); Set<Character> givenSet = s.replaceAll("\\s", "").toLowerCase().chars() .mapToObj(c -> (char)c) .collect(Collectors.toCollection(TreeSet::new)); return givenSet.equals(alphaSet) ? "pangram" : "not 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 →
Java solution: