kucheasysa

Algoverse_adesh_8

Jun 1st, 2024
1,008
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. class Solution:
  2.     def findWords(self, words: list[str]) -> list[str]:
  3.         rows = (set("qwertyuiop"), set("asdfghjkl"), set("zxcvbnm"))
  4.         return [w for w in words if any(set(w.lower()).issubset(row) for row in rows)]
Advertisement
Add Comment
Please, Sign In to add comment