Skip to content

Commit 59809ef

Browse files
author
Daniel Nallapalli
committed
Solution #500 (Python) - Daniel - 16/06/2025 - commit #4
1 parent 76b0b15 commit 59809ef

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(object):
2+
def findWords(self, words):
3+
"""
4+
:type words: List[str]
5+
:rtype: List[str]
6+
"""
7+
row1 = set("qwertyuiop")
8+
row2 = set("asdfghjkl")
9+
row3 = set("zxcvbnm")
10+
11+
result = []
12+
for word in words:
13+
lower_word = set(word.lower())
14+
if lower_word.issubset(row1) or lower_word.issubset(row2) or lower_word.issubset(row3):
15+
result.append(word)
16+
return result

0 commit comments

Comments
 (0)