Kata of the Day #8

Sentence Smash

kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
Kata of the Day #8

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!

TypeScript


export function smash (words: string[]): string {
   return words.join(" ");
}

Go


func Smash(words []string) string {
   return strings.Join(words, " ")
}

Python


def smash(words):
      return ' '.join(words)

PHP


function smash(array $words): string {
   return implode(' ', $words);
}

Go to Kata

Share

Need a budget?

Let's talk
budget
budget
budget
budget
budget
budget
budget
budget
budget
budget