Skip to content

Commit bab4a80

Browse files
committed
Added README.md file for Maximum Number of Words You Can Type
1 parent 41e7749 commit bab4a80

File tree

1 file changed

+39
-0
lines changed
  • 1264-maximum-number-of-words-you-can-type

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<h2><a href="https://leetcode.com/problems/maximum-number-of-words-you-can-type">Maximum Number of Words You Can Type</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p>There is a malfunctioning keyboard where some letter keys do not work. All other keys on the keyboard work properly.</p>
2+
3+
<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>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre>
9+
<strong>Input:</strong> text = &quot;hello world&quot;, brokenLetters = &quot;ad&quot;
10+
<strong>Output:</strong> 1
11+
<strong>Explanation:</strong> We cannot type &quot;world&quot; because the &#39;d&#39; key is broken.
12+
</pre>
13+
14+
<p><strong class="example">Example 2:</strong></p>
15+
16+
<pre>
17+
<strong>Input:</strong> text = &quot;leet code&quot;, brokenLetters = &quot;lt&quot;
18+
<strong>Output:</strong> 1
19+
<strong>Explanation:</strong> We cannot type &quot;leet&quot; because the &#39;l&#39; and &#39;t&#39; keys are broken.
20+
</pre>
21+
22+
<p><strong class="example">Example 3:</strong></p>
23+
24+
<pre>
25+
<strong>Input:</strong> text = &quot;leet code&quot;, brokenLetters = &quot;e&quot;
26+
<strong>Output:</strong> 0
27+
<strong>Explanation:</strong> We cannot type either word because the &#39;e&#39; key is broken.
28+
</pre>
29+
30+
<p>&nbsp;</p>
31+
<p><strong>Constraints:</strong></p>
32+
33+
<ul>
34+
<li><code>1 &lt;= text.length &lt;= 10<sup>4</sup></code></li>
35+
<li><code>0 &lt;= brokenLetters.length &lt;= 26</code></li>
36+
<li><code>text</code> consists of words separated by a single space without any leading or trailing spaces.</li>
37+
<li>Each word only consists of lowercase English letters.</li>
38+
<li><code>brokenLetters</code> consists of <strong>distinct</strong> lowercase English letters.</li>
39+
</ul>

0 commit comments

Comments
 (0)