Class Solution
java.lang.Object
g1901_2000.s1935_maximum_number_of_words_you_can_type.Solution
1935 - Maximum Number of Words You Can Type.<p>Easy</p>
<p>There is a malfunctioning keyboard where some letter keys do not work. All other keys on the keyboard work properly.</p>
<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>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> text = “hello world”, brokenLetters = “ad”</p>
<p><strong>Output:</strong> 1</p>
<p><strong>Explanation:</strong> We cannot type “world” because the ‘d’ key is broken.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> text = “leet code”, brokenLetters = “lt”</p>
<p><strong>Output:</strong> 1</p>
<p><strong>Explanation:</strong> We cannot type “leet” because the ‘l’ and ‘t’ keys are broken.</p>
<p><strong>Example 3:</strong></p>
<p><strong>Input:</strong> text = “leet code”, brokenLetters = “e”</p>
<p><strong>Output:</strong> 0</p>
<p><strong>Explanation:</strong> We cannot type either word because the ‘e’ key is broken.</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= text.length <= 10<sup>4</sup></code></li>
<li><code>0 <= brokenLetters.length <= 26</code></li>
<li><code>text</code> consists of words separated by a single space without any leading or trailing spaces.</li>
<li>Each word only consists of lowercase English letters.</li>
<li><code>brokenLetters</code> consists of <strong>distinct</strong> lowercase English letters.</li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
canBeTypedWords
-