/**
 * Given a sentence and a list of words to skip, return a new sentence with the skipped words removed.
 *
 * Example:
 * skipWord("The journalist continued to write interesting articles.", listOf("continued", "to"))
 * Output: "The journalist write interesting articles."
 *
 * Hint: Use the 'continue' statement combined with the 'in' statement to skip specific words.
 */
fun skipWord(sentence: String, wordsToSkip: List<String>): String {

    // Split the sentence into a list of words
    val words = sentence.split(" ")

    // Initialize an empty list to store the final sentence
    val newSentence = mutableListOf<String>()

    // Iterate over each word in the sentence
    for (word in words) {
        // Check if the word is in the list of words to skip
        if (word in wordsToSkip) {
            // Skip the word and continue to the next iteration
            continue
        }

        // Append the word to the new sentence
        newSentence.add(word)
    }

    // Join the words in the new sentence with spaces
    return newSentence.joinToString(" ")
}
/**
 * Given a sentence and a list of words to skip, return a new sentence with the skipped words removed.
 *
 * Example:
 * skipWord("The journalist continued to write interesting articles.", listOf("continued", "to"))
 * Output: "The journalist write interesting articles."
 *
 * Hint: Use the 'continue' statement combined with the 'in' statement to skip specific words.
 */
fun skipWord(sentence: String, wordsToSkip: List<String>): String {
/**
 * Given a sentence and a list of words to skip, return a new sentence with the skipped words removed.
 *
 * Example:
 * skipWord("The journalist continued to write interesting articles.", listOf("continued", "to"))
 * Output: "The journalist write interesting articles."
 *
 * Hint: Use the 'continue' statement combined with the 'in' statement to skip specific words.
 */
fun skipWord(sentence: String, wordsToSkip: List<String>): String {

    // Split the sentence into a list of words
    val words = sentence.split(" ")

    // Initialize an empty list to store the final sentence
    val newSentence = mutableListOf<String>()

    // Iterate over each word in the sentence
    for (word in words) {
        // Check if the word is in the list of words to skip
        if (word in wordsToSkip) {
            // Skip the word and continue to the next iteration
            continue
        }

        // Append the word to the new sentence
        newSentence.add(word)
    }

    // Join the words in the new sentence with spaces
    return newSentence.joinToString(" ")
}