/**
 * Given a sentence and a number, return a string that is the result of multiplying each word in the sentence
 * by the given number and then concatenating them together.
 *
 * Example:
 * sentence = "Hello world! This is a sentence."
 * num = 3
 * result = getNewString(sentence, num)
 * println(result)  // Output: "HelloHelloHello world!world!world! ThisThisThis isisissentence.sentence.sentence."
 *
 * @param sentence a string representing the input sentence
 * @param num an integer specifying the number of times each word needs to be repeated
 * @return a string containing the multiplied and concatenated words
 */
fun getNewString(sentence: String, num: Int): String {

    val words = sentence.split(" ")
    var newString = ""

    for (word in words) {
        newString += word.repeat(num)
    }

    return newString
}
/**
 * Given a sentence and a number, return a string that is the result of multiplying each word in the sentence
 * by the given number and then concatenating them together.
 *
 * Example:
 * sentence = "Hello world! This is a sentence."
 * num = 3
 * result = getNewString(sentence, num)
 * println(result)  // Output: "HelloHelloHello world!world!world! ThisThisThis isisissentence.sentence.sentence."
 *
 * @param sentence a string representing the input sentence
 * @param num an integer specifying the number of times each word needs to be repeated
 * @return a string containing the multiplied and concatenated words
 */
fun getNewString(sentence: String, num: Int): String {
/**
 * Given a sentence and a number, return a string that is the result of multiplying each word in the sentence
 * by the given number and then concatenating them together.
 *
 * Example:
 * sentence = "Hello world! This is a sentence."
 * num = 3
 * result = getNewString(sentence, num)
 * println(result)  // Output: "HelloHelloHello world!world!world! ThisThisThis isisissentence.sentence.sentence."
 *
 * @param sentence a string representing the input sentence
 * @param num an integer specifying the number of times each word needs to be repeated
 * @return a string containing the multiplied and concatenated words
 */
fun getNewString(sentence: String, num: Int): String {

    val words = sentence.split(" ")
    var newString = ""

    for (word in words) {
        newString += word.repeat(num)
    }

    return newString
}