forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_1935.java
More file actions
23 lines (22 loc) · 674 Bytes
/
_1935.java
File metadata and controls
23 lines (22 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.fishercoder.solutions;
public class _1935 {
public static class Solution1 {
public int canBeTypedWords(String text, String brokenLetters) {
String[] words = text.split(" ");
int count = 0;
for (String word : words) {
boolean broken = false;
for (char c : word.toCharArray()) {
if (brokenLetters.indexOf(c) != -1) {
broken = true;
break;
}
}
if (!broken) {
count++;
}
}
return count;
}
}
}