/**
 * Given a list of words and a minimum length, filter out the articles (i.e., words with less than the minimum length)
 * and return the remaining words in uppercase.
 *
 * @param words a list of words (strings)
 * @param length a positive integer representing the minimum length
 * @return a list of uppercase words (strings) without the articles
 */
fun filterArticles(words: List<String>, length: Int): List<String> {

    // Initialize an empty set to store the articles
    val articles = mutableSetOf<String>()

    // Loop through each word in the list
    for (word in words) {
        // Use loop control statement 'continue' to skip words with length less than the specified minimum length
        if (word.length < length) {
            continue
        }

        // Check if the word is an article ('a', 'an', 'the') and if so, add it to the set of articles
        if (word.toLowerCase() in setOf("a", "an", "the")) {
            articles.add(word.toLowerCase())
        }
    }

    // Use filter and map to generate a new list without the articles and return it in uppercase
    return words.filter { it.toLowerCase() !in articles }.map { it.toUpperCase() }
}
/**
 * Given a list of words and a minimum length, filter out the articles (i.e., words with less than the minimum length)
 * and return the remaining words in uppercase.
 *
 * @param words a list of words (strings)
 * @param length a positive integer representing the minimum length
 * @return a list of uppercase words (strings) without the articles
 */
fun filterArticles(words: List<String>, length: Int): List<String> {
/**
 * Given a list of words and a minimum length, filter out the articles (i.e., words with less than the minimum length)
 * and return the remaining words in uppercase.
 *
 * @param words a list of words (strings)
 * @param length a positive integer representing the minimum length
 * @return a list of uppercase words (strings) without the articles
 */
fun filterArticles(words: List<String>, length: Int): List<String> {

    // Initialize an empty set to store the articles
    val articles = mutableSetOf<String>()

    // Loop through each word in the list
    for (word in words) {
        // Use loop control statement 'continue' to skip words with length less than the specified minimum length
        if (word.length < length) {
            continue
        }

        // Check if the word is an article ('a', 'an', 'the') and if so, add it to the set of articles
        if (word.toLowerCase() in setOf("a", "an", "the")) {
            articles.add(word.toLowerCase())
        }
    }

    // Use filter and map to generate a new list without the articles and return it in uppercase
    return words.filter { it.toLowerCase() !in articles }.map { it.toUpperCase() }
}