Letter Wave
A stadium wave moves one person at a time; here, the wave moves one letter at a time. Write wave, which creates a list of copies of s, each with one different letter capitalized. Spaces do not take part in the wave, so they should not produce their own string.
Примеры
Ввод
"hello"Вывод
["Hello", "hEllo", "heLlo", "helLo", "hellO"]Ввод
""Вывод
[]Ввод
"two words"Вывод
["Two words", "tWo words", "twO words", "two Words", "two wOrds", "two woRds", "two worDs", "two wordS"]Нужно реализовать
def wave(s: str) -> list[str]:
Теги
stringsarray
Prijavite se za ogled zgodovine oddaj
PrijavaPrijavite se za uporabo mentorja UI
PrijavaVisible tests
1
Input
"hello"Expected
["Hello","hEllo","heLlo","helLo","hellO"]2
Input
""Expected
[]3
Input
"two words"Expected
["Two words","tWo words","twO words","two Words","two wOrds","two woRds","two worDs","two wordS"]4
Input
" gap "Expected
[" Gap "," gAp "," gaP "]5
Input
"a"Expected
["A"]6
Input
" "Expected
[]Focus radio
Paused · SomaFM · Fluid