/**
 * Given an article, this function finds the most common word in the article.
 *
 * @param article The article to analyze.
 * @return The most common word in the article.
 */
fun findMostCommonWord(article: String): String {

    // Step 1: Create a list of all words in the article
    val words = article.split(" ")

    // Step 2: Create a map to count the frequency of each word
    val wordCount = mutableMapOf<String, Int>()
    for (word in words) {
        wordCount[word] = wordCount.getOrDefault(word, 0) + 1
    }

    // Step 3: Find the most common word
    var mostCommonWord = ""
    var highestFrequency = 0
    for ((word, frequency) in wordCount) {
        if (frequency > highestFrequency) {
            mostCommonWord = word
            highestFrequency = frequency
        }
    }

    return mostCommonWord
}
/**
 * Given an article, this function finds the most common word in the article.
 *
 * @param article The article to analyze.
 * @return The most common word in the article.
 */
fun findMostCommonWord(article: String): String {
/**
 * Given an article, this function finds the most common word in the article.
 *
 * @param article The article to analyze.
 * @return The most common word in the article.
 */
fun findMostCommonWord(article: String): String {

    // Step 1: Create a list of all words in the article
    val words = article.split(" ")

    // Step 2: Create a map to count the frequency of each word
    val wordCount = mutableMapOf<String, Int>()
    for (word in words) {
        wordCount[word] = wordCount.getOrDefault(word, 0) + 1
    }

    // Step 3: Find the most common word
    var mostCommonWord = ""
    var highestFrequency = 0
    for ((word, frequency) in wordCount) {
        if (frequency > highestFrequency) {
            mostCommonWord = word
            highestFrequency = frequency
        }
    }

    return mostCommonWord
}