You are viewing a single comment's thread. Return to all comments →
System.out.println(in.nextLine().replace(" ", "").toLowerCase().chars().boxed().collect(Collectors.toSet()).size() == 26 ? "pangram" : "not pangram");
Java 8. Single Line. And O(1) complexity.
Pangrams
You are viewing a single comment's thread. Return to all comments →
System.out.println(in.nextLine().replace(" ", "").toLowerCase().chars().boxed().collect(Collectors.toSet()).size() == 26 ? "pangram" : "not pangram");
Java 8. Single Line. And O(1) complexity.