class Solution: def findWords(self, words: List[str]) -> List[str]: ans = [] rowIdx = "12210111011122000010020202" for word in words: idx = rowIdx[ord(word[0].lower()) - ord('a')] if all(rowIdx[ord(ch.lower()) - ord('a')] == idx for ch in word): ans.append(word) return ans
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)