42 ms python filter set comprehension


  • 0
    V
    class Solution(object):
        def findWords(self, words):
            """
            :type words: List[str]
            :rtype: List[str]
            """
            return filter(lambda x : (set(x.lower()).issubset(set('qwertyuiop')) | set(x.lower()).issubset(set('asdfghjkl')) | set(x.lower()).issubset(set('zxcvbnm')) ),words)```

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.