clear python solution


  • 0
    N
    class Solution(object):
        def findWords(self, words):
            """
            :type words: List[str]
            :rtype: List[str]
            """
            row1 = set("qwertyuiopQWERTYUIOP")
            row2 = set("asdfghjklASDFGHJKL")
            row3 = set("zxcvbnmZXCVBNM")
            
            return [word for word in words if set(word)<=row1 or
                                              set(word)<=row2 or
                                              set(word)<=row3]
    

Log in to reply
 

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