Longest word using a single row of the qwerty keyboard The three rows of the qwerty keyboard are qwertyuiop, asdfghjkl and zxcvbnm. Your task is to find the longest word that can be typed using only one row of the keyboard, from a given list of words.

Sample input 1

artist
home
gas
writer
geology
marine
twerp


Output

writer


(Of the given words, only gas, writer and twerp can be written using a single row, and writer is the longest)

The words may not be actual words (so don't assume the third row to be invalid). However, you can assume that there will always be exactly one answer (no more, no less).

Sample input 2

wrhuji
bxnzmmx
gllwssjjd
vnccbb
lrkjhgfdsa
tttttt


Output

bxnzmmx


Additional punctuation and whitespaces can be provided in input (as per language requirements). However, no extra output should be given. Input and output are in lower case. Shortest code wins.
Python 2, 84 bytes

lambda l:max(l,key=lambda w:(-len({&quot;asdfghjklzxcvbnm&quot;.find(c)/9for c in w}),len(w)))

Finds the max of the input, comparing by fewer keyboard rows spanned, then in increasing length. The keyboard row value is extracted by &quot;asdfghjklzxcvbnm&quot;.find(c)/9, which takes the middle row to 0, the bottom row to 1, and the top row, which is excluded, to -1, since find gives -1 for missing values.
Other attempts:
lambda l:max((-len({&quot;asdfghjklzxcvbnm&quot;.find(c)/9for c in w}),len(w),w)for w in l)[2]
lambda l:max(l,key=lambda w:len(w)-1./len({&quot;asdfghjklzxcvbnm&quot;.find(c)/9for c in w}))
lambda l:max([w for w in l if len({&quot;asdfghjklzxcvbnm&quot;.find(c)/9for c in w})&lt;2],key=len)