/**
 * This function counts the number of articles published in a given year.
 *
 * @param articles A list of dictionaries representing articles.
 * @param year The year to count articles for.
 * @return The total number of articles published in the given year.
 */
fun countArticlesByYear(articles: List<Map<String, Any>>, year: Int): Int {

    var count = 0

    for (article in articles) {
        if (article.containsKey("year") && article["year"] == year) {
            count++
        }
    }

    return count
}
/**
 * This function counts the number of articles published in a given year.
 *
 * @param articles A list of dictionaries representing articles.
 * @param year The year to count articles for.
 * @return The total number of articles published in the given year.
 */
fun countArticlesByYear(articles: List<Map<String, Any>>, year: Int): Int {
/**
 * This function counts the number of articles published in a given year.
 *
 * @param articles A list of dictionaries representing articles.
 * @param year The year to count articles for.
 * @return The total number of articles published in the given year.
 */
fun countArticlesByYear(articles: List<Map<String, Any>>, year: Int): Int {

    var count = 0

    for (article in articles) {
        if (article.containsKey("year") && article["year"] == year) {
            count++
        }
    }

    return count
}