Skip to content

Commit ac3f601

Browse files
authored
Update Check if the Sentence Is Pangram.java
1 parent be7be69 commit ac3f601

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
class Solution {
22
public boolean checkIfPangram(String sentence) {
3-
Set<Character> allUnique = sentence.chars().mapToObj(c -> (char) c).collect(Collectors.toSet());
4-
return "abcdefghijklmnopqrstuvwxyz".chars().mapToObj(c -> (char) c)
5-
.allMatch(allUnique::contains);
3+
return sentence.chars().mapToObj(c -> (char) c).collect(Collectors.toSet()).size() == 26;
64
}
75
}

0 commit comments

Comments
 (0)