#500
Keyboard Row
pupil · 300 · lc easy +20 · 73.6% accepted · 1,813 likes · top 84%
Description
Given an array of strings words, return the words that can be typed using letters of the alphabet on only one row of an American QWERTY keyboard. The check is case-insensitive.
In the American keyboard:
- the first row consists of the characters "qwertyuiop",
- the second row consists of the characters "asdfghjkl", and
- the third row consists of the characters "zxcvbnm".
Code
1
2
3