File tree 2 files changed +26
-0
lines changed 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 190
190
1780|[ Check if Number is a Sum of Powers of Three] ( ./1780-check-if-number-is-a-sum-of-powers-of-three.js ) |Medium|
191
191
1880|[ Check if Word Equals Summation of Two Words] ( ./1880-check-if-word-equals-summation-of-two-words.js ) |Easy|
192
192
1929|[ Concatenation of Array] ( ./1929-concatenation-of-array.js ) |Easy|
193
+ 1935|[ Maximum Number of Words You Can Type] ( ./1935-maximum-number-of-words-you-can-type.js ) |Easy|
193
194
2000|[ Reverse Prefix of Word] ( ./2000-reverse-prefix-of-word.js ) |Easy|
194
195
2016|[ Maximum Difference Between Increasing Elements] ( ./2016-maximum-difference-between-increasing-elements.js ) |Easy|
195
196
Original file line number Diff line number Diff line change
1
+ /**
2
+ * 1935. Maximum Number of Words You Can Type
3
+ * https://leetcode.com/problems/maximum-number-of-words-you-can-type/
4
+ * Difficulty: Easy
5
+ *
6
+ * There is a malfunctioning keyboard where some letter keys do not work.
7
+ * All other keys on the keyboard work properly.
8
+ *
9
+ * Given a string text of words separated by a single space (no leading or
10
+ * trailing spaces) and a string brokenLetters of all distinct letter keys
11
+ * that are broken, return the number of words in text you can fully type
12
+ * using this keyboard.
13
+ */
14
+
15
+ /**
16
+ * @param {string } text
17
+ * @param {string } brokenLetters
18
+ * @return {number }
19
+ */
20
+ var canBeTypedWords = function ( text , brokenLetters ) {
21
+ return text
22
+ . split ( / \s + / )
23
+ . filter ( word => ! brokenLetters . split ( '' ) . some ( s => word . includes ( s ) ) )
24
+ . length ;
25
+ } ;
You can’t perform that action at this time.
0 commit comments