1935. Maximum Number of Words You Can Type

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1935

class Solution:
    def canBeTypedWords(self, text: str, brokenLetters: str) -> int:
        s = set(brokenLetters)
        return sum(all(c not in s for c in w) for w in text.split())