Ctrl K

One-Row Typing

Easy
On a standard English keyboard the letters sit in three rows: - top: qwertyuiop - middle: asdfghjkl - bottom: zxcvbnm Given a list of words words, return the ones that can be typed without leaving a single row, in their original order. Uppercase and lowercase versions of a letter count as the same key.
Example 1
words=["Typewriter", "Flask", "Mango", "Zebra"] → ['Typewriter', 'Flask']

Every letter of Typewriter is on the top row and every letter of Flask on the middle row. Mango and Zebra mix rows.

Example 2
words=["ZZ", "Quiz"] → ['ZZ']

ZZ lies entirely on the bottom row, while the z in Quiz is on a different row from the rest.

Constraints
  • 1 ≤ len(words) ≤ 100
  • 1 ≤ len(words[i]) ≤ 100
  • Words consist of English letters in either case
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsDinner for Two EasyPhrases with Synonyms EasyWord from a License Plate EasyDistinct Morse Signals EasyReal Inboxes Behind the Addresses Easy
loading Python…
Input
words=["Typewriter", "Flask", "Mango", "Zebra"]
Expected
['Typewriter', 'Flask']

Run checks the first 3 tests in your browser. Submit checks all 80 tests on the server, hidden ones included.