Practice Keyboard Row
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Return the words whose letters can all be typed using one row of an American keyboard. Ignore letter case. The three allowed rows are qwertyuiop, asdfghjkl and zxcvbnm. Every letter of a returned word must belong to the same row.
Source: Keyboard Row on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
words = ["Hello","Alaska","Dad","Peace"]
Output
["Alaska","Dad"]
# Example 2
Input
words = ["omk"]
Output
[]
# Example 3
Input
words = ["adsdf","sfd"]
Output
["adsdf","sfd"]
Constraints
1 <= words.length <= 20
1 <= words[i].length <= 100
words[i] consists of English letters (both lowercase and uppercase).
Related LeetCode Problems
Practice more problems similar to Keyboard Row.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.