File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /**
2+ * 1935. Maximum Number of Words You Can Type
3+ *
4+ * @param {string } text
5+ * @param {string } brokenLetters
6+ * @return {number }
7+ */
8+ var canBeTypedWords = function ( text , brokenLetters ) {
9+ const broken = new Set ( brokenLetters ) ;
10+ const split = text . split ( " " ) ;
11+ let ans = 0 ;
12+
13+ for ( const t of split ) {
14+ for ( const c of t ) {
15+ if ( broken . has ( c ) ) {
16+ ans ++ ;
17+ }
18+ }
19+ }
20+ return ans ;
21+ } ;
22+ let text = "hello world" , brokenLetters = "ad" ;
23+ // 1
24+ console . log ( canBeTypedWords ( text , brokenLetters ) ) ;
Original file line number Diff line number Diff line change @@ -1045,4 +1045,5 @@ var fractionToDecimal = function(numerator, denominator) {
10451045} ;
10461046let numerator = 1 , denominator = 2 ;
10471047// "0.5"
1048- // console.log(fractionToDecimal(numerator,denominator));
1048+ // console.log(fractionToDecimal(numerator,denominator));
1049+
You can’t perform that action at this time.
0 commit comments