/**
 * Given a list of words and a number, appends only the words that contain more than 'number' characters to a new list.
 * However, the words are appended in reverse order of appearance in the original list.
 */
fun appendWordsToList(words: List<String>, number: Int): List<String> {

    // Initialize an empty list to store the words
    val newList = mutableListOf<String>()

    // Iterate over the words in reverse order
    for (i in words.indices.reversed()) {
        val word = words[i]

        // Check if the length of the word is greater than 'number'
        if (word.length > number) {
            // Append the word to the new list
            newList.add(word)
        }
    }

    return newList
}
/**
 * Given a list of words and a number, appends only the words that contain more than 'number' characters to a new list.
 * However, the words are appended in reverse order of appearance in the original list.
 */
fun appendWordsToList(words: List<String>, number: Int): List<String> {
/**
 * Given a list of words and a number, appends only the words that contain more than 'number' characters to a new list.
 * However, the words are appended in reverse order of appearance in the original list.
 */
fun appendWordsToList(words: List<String>, number: Int): List<String> {

    // Initialize an empty list to store the words
    val newList = mutableListOf<String>()

    // Iterate over the words in reverse order
    for (i in words.indices.reversed()) {
        val word = words[i]

        // Check if the length of the word is greater than 'number'
        if (word.length > number) {
            // Append the word to the new list
            newList.add(word)
        }
    }

    return newList
}