Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Words You Can Type

med
30 min
Try to solve the Maximum Number of Words You Can Type problem.

Statement

Given a string text of words separated by a single space and a string brokenLetters containing distinct characters representing keys on a malfunctioning keyboard, return the total count of words in text that can be fully typed without using any broken key.

A word can be typed if and only if none of its letters are in brokenLetters.

Constraints:

  • 1≤1 \le text.length ≤104\le 10^4

  • 0≤0 \le brokenLetters.length ≤26\le 26

  • text consists of words separated by a single space without any leading or trailing spaces.

  • Each word consists only of lowercase English letters.

  • brokenLetters consists of distinct lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Words You Can Type

med
30 min
Try to solve the Maximum Number of Words You Can Type problem.

Statement

Given a string text of words separated by a single space and a string brokenLetters containing distinct characters representing keys on a malfunctioning keyboard, return the total count of words in text that can be fully typed without using any broken key.

A word can be typed if and only if none of its letters are in brokenLetters.

Constraints:

  • 1≤1 \le text.length ≤104\le 10^4

  • 0≤0 \le brokenLetters.length ≤26\le 26

  • text consists of words separated by a single space without any leading or trailing spaces.

  • Each word consists only of lowercase English letters.

  • brokenLetters consists of distinct lowercase English letters.