python two liner


  • 0
    S
    rows = ['qwertyuiopQWERTYUIOP', 'asdfghjklASDFGHJKL', 'zxcvbnmZXCVBNM']
    return [word for word in words if any([all([ch in row for ch in word]) for row in rows])]
    

    Following Stefan's style :D


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.