/**
 * This exercise requires you to complete the code to filter out the articles that have been updated after a certain date using the 'in' operator.
 *
 * @param articles A list of dictionaries representing articles with 'title' and 'updated_date' keys.
 * @param updateDate A string representing the date in the format 'YYYY-MM-DD'.
 * @return A list of dictionaries representing the updated articles.
 */
fun getUpdatedArticles(articles: List<Map<String, String>>, updateDate: String): List<Map<String, String>> {

    val updatedArticles = mutableListOf<Map<String, String>>()

    // Iterate over each article in the list
    for (article in articles) {
        // Check if the article's 'updated_date' is newer than the specified 'updateDate'
        if (article["updated_date"]!! > updateDate) {
            // If true, add the article to the list of updatedArticles
            updatedArticles.add(article)
        }
    }

    return updatedArticles
}

// Example usage
val articles = listOf(
    mapOf("title" to "Article 1", "updated_date" to "2022-01-15"),
    mapOf("title" to "Article 2", "updated_date" to "2022-02-05"),
    mapOf("title" to "Article 3", "updated_date" to "2022-03-20")
)
/**
 * This exercise requires you to complete the code to filter out the articles that have been updated after a certain date using the 'in' operator.
 *
 * @param articles A list of dictionaries representing articles with 'title' and 'updated_date' keys.
 * @param updateDate A string representing the date in the format 'YYYY-MM-DD'.
 * @return A list of dictionaries representing the updated articles.
 */
fun getUpdatedArticles(articles: List<Map<String, String>>, updateDate: String): List<Map<String, String>> {
/**
 * This exercise requires you to complete the code to filter out the articles that have been updated after a certain date using the 'in' operator.
 *
 * @param articles A list of dictionaries representing articles with 'title' and 'updated_date' keys.
 * @param updateDate A string representing the date in the format 'YYYY-MM-DD'.
 * @return A list of dictionaries representing the updated articles.
 */
fun getUpdatedArticles(articles: List<Map<String, String>>, updateDate: String): List<Map<String, String>> {

    val updatedArticles = mutableListOf<Map<String, String>>()

    // Iterate over each article in the list
    for (article in articles) {
        // Check if the article's 'updated_date' is newer than the specified 'updateDate'
        if (article["updated_date"]!! > updateDate) {
            // If true, add the article to the list of updatedArticles
            updatedArticles.add(article)
        }
    }

    return updatedArticles
}

// Example usage
val articles = listOf(
    mapOf("title" to "Article 1", "updated_date" to "2022-01-15"),
    mapOf("title" to "Article 2", "updated_date" to "2022-02-05"),
    mapOf("title" to "Article 3", "updated_date" to "2022-03-20")
)