class Solution:
def isAllIn(self, word, strs):
flag = True
for s in word:
if s not in strs:
flag = False
return flag
def findWords(self, words):
"""
:type words: List[str]
:rtype: List[str]
"""
dict = {1: "QWERTYUIOP", 2: "ASDFGHJKL", 3: "ZXCVBNM"}
list = []
for word in words:
if self.isAllIn(word.upper(), dict[1]) or self.isAllIn(word.upper(),dict[2]) or self.isAllIn(word.upper(), dict[3]):
list.append(word)
return list