Skip to content
Discussion options

You must be logged in to vote

We need to determine how many words in a given string can be fully typed using a keyboard where some keys are broken. The solution involves checking each word in the input string to see if it contains any of the broken letters. If a word does not contain any broken letters, it can be typed completely.

Approach

  1. Split the Text into Words: The input string text consists of words separated by single spaces. We split this string into individual words.
  2. Create a Set of Broken Letters: Convert the string brokenLetters into a set (or an array) for efficient lookup. This allows us to quickly check if a letter is broken.
  3. Check Each Word: For each word, check every character. If any character is fou…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@basharul-siddike
Comment options

@mah-shamim
Comment options

mah-shamim Sep 15, 2025
Maintainer Author

Answer selected by basharul-siddike
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested easy Difficulty
2 participants