Words from keyboard rows

Question

Suppose you’re given a list of words. Using this list, return only the words that can be typed by using letters of the alphabet on a single row of a standard American “qwerty” keyboard (as shown below):

Words from keyboard rows - 1

For example:

 input = ['Hello', 'Had', 'Rope', 'Smile']
 output = ['Had', 'Rope'] 

Some additional notes:

  • You can use a character in the keyboard more than once
  • The input string will only contain letters of the alphabet

Solution

Access restricted

Subscribe to premium account to see the solution.

Get premium now