/**
 * You are a journalist and you have a dictionary of articles where the keys are the article titles and the values are the corresponding word counts. Your task is to find the article with the highest word count and return its title. If there are multiple articles with the same highest word count, return the title of the first one encountered.
 *
 * @param articles A dictionary containing article titles as keys and their word counts as values.
 * @return The title of the article with the highest word count.
 */
fun findHighestArticleWordCount(articles: Map<String, Int>): String {

    var highestWordCount = 0
    var articleTitle = ""

    // Iterate over each key-value pair in the articles dictionary
    for ((title, wordCount) in articles) {
        // Check if the word count of the current article is higher than the previous highest word count
        if (wordCount > highestWordCount) {
            highestWordCount = wordCount
            articleTitle = title
        }
    }

    return articleTitle
}
/**
 * You are a journalist and you have a dictionary of articles where the keys are the article titles and the values are the corresponding word counts. Your task is to find the article with the highest word count and return its title. If there are multiple articles with the same highest word count, return the title of the first one encountered.
 *
 * @param articles A dictionary containing article titles as keys and their word counts as values.
 * @return The title of the article with the highest word count.
 */
fun findHighestArticleWordCount(articles: Map<String, Int>): String {
/**
 * You are a journalist and you have a dictionary of articles where the keys are the article titles and the values are the corresponding word counts. Your task is to find the article with the highest word count and return its title. If there are multiple articles with the same highest word count, return the title of the first one encountered.
 *
 * @param articles A dictionary containing article titles as keys and their word counts as values.
 * @return The title of the article with the highest word count.
 */
fun findHighestArticleWordCount(articles: Map<String, Int>): String {

    var highestWordCount = 0
    var articleTitle = ""

    // Iterate over each key-value pair in the articles dictionary
    for ((title, wordCount) in articles) {
        // Check if the word count of the current article is higher than the previous highest word count
        if (wordCount > highestWordCount) {
            highestWordCount = wordCount
            articleTitle = title
        }
    }

    return articleTitle
}