Skip to content

Commit b88fa85

Browse files
add 1935
1 parent e1bdc1d commit b88fa85

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag 1
1010
|-----|----------------|---------------|--------|-------------|-------------
11+
|1935|[Maximum Number of Words You Can Type](https://leetcode.com/problems/maximum-number-of-words-you-can-type/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1935.java) ||Easy|String|
1112
|1929|[Concatenation of Array](https://leetcode.com/problems/concatenation-of-array/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1929.java) ||Easy||
1213
|1926|[Nearest Exit from Entrance in Maze](https://leetcode.com/problems/nearest-exit-from-entrance-in-maze/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1926.java) ||Medium|DP, DFS, BFS|
1314
|1925|[Count Square Sum Triples](https://leetcode.com/problems/count-square-sum-triples/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1925.java) ||Easy|Array, Greedy|
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.fishercoder.solutions;
2+
3+
public class _1935 {
4+
public static class Solution1 {
5+
public int canBeTypedWords(String text, String brokenLetters) {
6+
String[] words = text.split(" ");
7+
int count = 0;
8+
for (String word : words) {
9+
boolean broken = false;
10+
for (char c : word.toCharArray()) {
11+
if (brokenLetters.indexOf(c) != -1) {
12+
broken = true;
13+
break;
14+
}
15+
}
16+
if (!broken) {
17+
count++;
18+
}
19+
}
20+
return count;
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)