Skip to content

Commit 9199efa

Browse files
authored
Create Maximum Number of Words You Can Type.java
1 parent 921a7e8 commit 9199efa

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Solution {
2+
public int canBeTypedWords(String text, String brokenLetters) {
3+
return (int) Arrays.stream(text.split("\\s+"))
4+
.filter(e -> e.chars()
5+
.mapToObj(c -> (char) c)
6+
.noneMatch(c -> brokenLetters.indexOf(c) != -1))
7+
.count();
8+
}
9+
}

0 commit comments

Comments
 (0)