|
1 | 1 | # 1935. Maximum Number of Words You Can Type [Rating: 1226.83] |
2 | 2 |
|
3 | | -There is a malfunctioning keyboard where some letter keys do not work. All other keys on the keyboard work properly. |
| 3 | +<p>There is a malfunctioning keyboard where some letter keys do not work. All other keys on the keyboard work properly.</p> |
4 | 4 |
|
5 | | -Given a string `text` of words separated by a single space (no leading or trailing spaces) and a string `brokenLetters` of all **distinct** letter keys that are broken, return *the **number of words** in* `text` *you can fully type using this keyboard*. |
| 5 | +<p>Given a string <code>text</code> of words separated by a single space (no leading or trailing spaces) and a string <code>brokenLetters</code> of all <strong>distinct</strong> letter keys that are broken, return <em>the <strong>number of words</strong> in</em> <code>text</code> <em>you can fully type using this keyboard</em>.</p> |
6 | 6 |
|
7 | | - |
| 7 | +<p> </p> |
| 8 | +<p><strong class="example">Example 1:</strong></p> |
8 | 9 |
|
9 | | -**Example 1:** |
| 10 | +<pre> |
| 11 | +<strong>Input:</strong> text = "hello world", brokenLetters = "ad" |
| 12 | +<strong>Output:</strong> 1 |
| 13 | +<strong>Explanation:</strong> We cannot type "world" because the 'd' key is broken. |
| 14 | +</pre> |
10 | 15 |
|
11 | | -``` |
12 | | -Input: text = "hello world", brokenLetters = "ad" |
13 | | -Output: 1 |
14 | | -Explanation: We cannot type "world" because the 'd' key is broken. |
15 | | -``` |
| 16 | +<p><strong class="example">Example 2:</strong></p> |
16 | 17 |
|
17 | | -**Example 2:** |
| 18 | +<pre> |
| 19 | +<strong>Input:</strong> text = "leet code", brokenLetters = "lt" |
| 20 | +<strong>Output:</strong> 1 |
| 21 | +<strong>Explanation:</strong> We cannot type "leet" because the 'l' and 't' keys are broken. |
| 22 | +</pre> |
18 | 23 |
|
19 | | -``` |
20 | | -Input: text = "leet code", brokenLetters = "lt" |
21 | | -Output: 1 |
22 | | -Explanation: We cannot type "leet" because the 'l' and 't' keys are broken. |
23 | | -``` |
| 24 | +<p><strong class="example">Example 3:</strong></p> |
24 | 25 |
|
25 | | -**Example 3:** |
| 26 | +<pre> |
| 27 | +<strong>Input:</strong> text = "leet code", brokenLetters = "e" |
| 28 | +<strong>Output:</strong> 0 |
| 29 | +<strong>Explanation:</strong> We cannot type either word because the 'e' key is broken. |
| 30 | +</pre> |
26 | 31 |
|
27 | | -``` |
28 | | -Input: text = "leet code", brokenLetters = "e" |
29 | | -Output: 0 |
30 | | -Explanation: We cannot type either word because the 'e' key is broken. |
31 | | -``` |
32 | | - |
33 | | - |
34 | | - |
35 | | -**Constraints:** |
36 | | - |
37 | | -- 1 <= text.length <= 10<sup>4</sup> |
38 | | -- `0 <= brokenLetters.length <= 26` |
39 | | -- `text` consists of words separated by a single space without any leading or trailing spaces. |
40 | | -- Each word only consists of lowercase English letters. |
41 | | -- `brokenLetters` consists of **distinct** lowercase English letters. |
| 32 | +<p> </p> |
| 33 | +<p><strong>Constraints:</strong></p> |
42 | 34 |
|
| 35 | +<ul> |
| 36 | + <li><code>1 <= text.length <= 10<sup>4</sup></code></li> |
| 37 | + <li><code>0 <= brokenLetters.length <= 26</code></li> |
| 38 | + <li><code>text</code> consists of words separated by a single space without any leading or trailing spaces.</li> |
| 39 | + <li>Each word only consists of lowercase English letters.</li> |
| 40 | + <li><code>brokenLetters</code> consists of <strong>distinct</strong> lowercase English letters.</li> |
| 41 | +</ul> |
0 commit comments