Same Keyboard Row
On a QWERTY keyboard, letters are arranged in three rows, and some words can be typed without moving to another row. Given a list words, return only the words whose letters all belong to one row: qwertyuiop, asdfghjkl, or zxcvbnm. Letter case does not matter, but return the words in their original spelling.
Примеры
Ввод
["Hello", "Alaska", "Dad", "Peace"]Вывод
["Alaska", "Dad"]Ввод
["qwerty"]Вывод
["qwerty"]Ввод
["abc"]Вывод
[]Нужно реализовать
def find_keyboard_row(words: list[str]) -> list[str]:
Теги
setstringshashmap
Prihláste sa, aby ste videli históriu odoslaní
Prihlásiť saPrihláste sa, aby ste mohli používať AI mentora
Prihlásiť saTests12
Visible tests
Skrytý test 7
Skrytý test 8
Skrytý test 9
Skrytý test 10
Skrytý test 11
Skrytý test 12
They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.
Focus radio
Paused · SomaFM · Fluid