Skip to content

Commit a68d3d6

Browse files
committed
500 - Python
1 parent 3be42d0 commit a68d3d6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Solution:
2+
def findWords(self, words):
3+
"""
4+
:type words: List[str]
5+
:rtype: List[str]
6+
"""
7+
8+
Rows={"q":0, "w":0, "e":0, "r":0, "t":0, "y":0, "u":0, "i":0, "o":0, "p":0, "a":1, "s":1, "d":1, "f":1, "g":1, "h":1, "j":1, "k":1, "l":1, "z":2, "x":2, "c":2, "v":2, "b":2, "n":2, "m":2}
9+
10+
Final = []
11+
for each in words :
12+
13+
if all([Rows[each[0].lower()]==Rows[ch] for ch in each.lower()]) :
14+
Final.append(each)
15+
16+
return Final

0 commit comments

Comments
 (0)