반응형
Sentence Smash
Write a function that takes an array of words and smashes them together into a sentence and returns the sentence. You can ignore any need to sanitize words or add punctuation, but you should add spaces between each word. Be careful, there shouldn't be a space at the beginning or the end of the sentence!
Example
['hello', 'world', 'this', 'is', 'great'] => 'hello world this is great'
Solution:
def smash(words):
return join(words, " ")
def join(words, space):
return space.join(words)
반응형
'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글
1111. Grasshopper - Debug sayHello (0) | 2022.11.12 |
---|---|
1110. No oddities here (0) | 2022.11.10 |
1108. JavaScript Array Filter (0) | 2022.11.09 |
1107. I love you, a little , a lot, passionately ... not at all (0) | 2022.11.07 |
1106. Grasshopper - Messi Goals (0) | 2022.11.07 |