# 15.09.2025 [1935. Maximum Number of Words You Can Type]
Count words with all letters #easy
15.09.2025
1935. Maximum Number of Words You Can Type easy blog post substack youtube
Join me on Telegram
Problem TLDR
Count words with all letters #easy
Intuition
No special algo here. Broken letters is up to 26, no hashset needed.
Approach
write a one-liner
Complexity
Time complexity: $$O(n)$$
Space complexity: $$O(n)$$
Code
// 14ms
fun canBeTypedWords(txt: String, bl: String) =
txt.split(" ").count { it.all { it !in bl}}
// 0ms
pub fn can_be_typed_words(txt: String, bl: String) -> i32 {
txt.split(" ").filter(|w| !w.chars().any(|c| bl.contains(c))).count() as _
}


