/**
 * Given a sentence and a number of repetitions, this function manipulates the string by reversing 
 * the letters in each word and repeating the sentence.
 *
 * @param sentence A string representing the sentence.
 * @param numRepetitions An integer representing the number of repetitions.
 * @return The manipulated string.
 */
fun manipulateString(sentence: String, numRepetitions: Int): String {

    var manipulatedSentence = ""
    val words = sentence.split(" ")
    for (word in words) {
        var reversedWord = ""
        for (i in word.length - 1 downTo 0) {
            reversedWord += word[i]
        }
        manipulatedSentence += "$reversedWord "
    }
    manipulatedSentence = manipulatedSentence.trim().repeat(numRepetitions)
    return manipulatedSentence
}
/**
 * Given a sentence and a number of repetitions, this function manipulates the string by reversing 
 * the letters in each word and repeating the sentence.
 *
 * @param sentence A string representing the sentence.
 * @param numRepetitions An integer representing the number of repetitions.
 * @return The manipulated string.
 */
fun manipulateString(sentence: String, numRepetitions: Int): String {
/**
 * Given a sentence and a number of repetitions, this function manipulates the string by reversing 
 * the letters in each word and repeating the sentence.
 *
 * @param sentence A string representing the sentence.
 * @param numRepetitions An integer representing the number of repetitions.
 * @return The manipulated string.
 */
fun manipulateString(sentence: String, numRepetitions: Int): String {

    var manipulatedSentence = ""
    val words = sentence.split(" ")
    for (word in words) {
        var reversedWord = ""
        for (i in word.length - 1 downTo 0) {
            reversedWord += word[i]
        }
        manipulatedSentence += "$reversedWord "
    }
    manipulatedSentence = manipulatedSentence.trim().repeat(numRepetitions)
    return manipulatedSentence
}