500. Keyboard Row

xiaoxiao2021-02-28  103

class Solution(object):     def findWords(self, words):         """         :type words: List[str]         :rtype: List[str]         """         c=['qwertyuiopQWERTYUIOP','asdfghjklASDFGHJKL','zxcvbnmZXCVBNM']         res=[]         for i in range(len(words)):             for r in range(3):                 flag=True                 for j in words[i]:                     if j not in c[r]:                         flag=False                         break                 if flag:                     res.append(words[i])                     break                     

        return res

单词在同一行的序列

取单词,每一行验证单词

                    
转载请注明原文地址: https://www.6miu.com/read-82139.html

最新回复(0)