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!
export function smash (words: string[]): string {
return words.join(" ");
}
func Smash(words []string) string {
return strings.Join(words, " ")
}
def smash(words):
return ' '.join(words)
function smash(array $words): string {
return implode(' ', $words);
}
Go to Kata
Want us to give you some help with your business? No problem, here's a video on who we can help, and how, along with our calendar so you can book in a call to discuss us working together.
Let's see