/**
 * This function searches for the occurrence of two given keywords in a given article and returns the intersection of the two keywords.
 *
 * @param article The text of the article.
 * @param word1 The first keyword.
 * @param word2 The second keyword.
 * @return The set of words that appear both as word1 and word2 in the article.
 */
fun findKeywords(article: String, word1: String, word2: String): Set<String> {

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

    // Iterate over each word in the article
    for (word in article.split(" ")) {
        // Check if the word matches the first keyword
        if (word == word1) {
            // Use the "continue" statement to skip the remaining code and move to the next iteration
            continue
        }

        // Check if the word matches the second keyword
        if (word == word2) {
            // Add the word to the set of common words
            commonWords.add(word)
        }
    }

    return commonWords
}
/**
 * This function searches for the occurrence of two given keywords in a given article and returns the intersection of the two keywords.
 *
 * @param article The text of the article.
 * @param word1 The first keyword.
 * @param word2 The second keyword.
 * @return The set of words that appear both as word1 and word2 in the article.
 */
fun findKeywords(article: String, word1: String, word2: String): Set<String> {
/**
 * This function searches for the occurrence of two given keywords in a given article and returns the intersection of the two keywords.
 *
 * @param article The text of the article.
 * @param word1 The first keyword.
 * @param word2 The second keyword.
 * @return The set of words that appear both as word1 and word2 in the article.
 */
fun findKeywords(article: String, word1: String, word2: String): Set<String> {

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

    // Iterate over each word in the article
    for (word in article.split(" ")) {
        // Check if the word matches the first keyword
        if (word == word1) {
            // Use the "continue" statement to skip the remaining code and move to the next iteration
            continue
        }

        // Check if the word matches the second keyword
        if (word == word2) {
            // Add the word to the set of common words
            commonWords.add(word)
        }
    }

    return commonWords
}