/**
 * This function filters out articles based on a given category and keyword.
 *
 * @param articles A list of dictionaries representing articles.
 * @param category The category of articles to filter.
 * @param keyword The keyword to search for in the articles' titles.
 * @return A filtered list of articles matching the given category and keyword.
 */
fun filterArticles(articles: List<Map<String, String>>, category: String, keyword: String): List<Map<String, String>> {

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

    for (article in articles) {
        if (article.containsKey("category") && article["category"] == category) {
            if (article.containsKey("title") && keyword in article["title"]!!) {
                filteredArticles.add(article)
            }
        }
    }

    return filteredArticles
}
/**
 * This function filters out articles based on a given category and keyword.
 *
 * @param articles A list of dictionaries representing articles.
 * @param category The category of articles to filter.
 * @param keyword The keyword to search for in the articles' titles.
 * @return A filtered list of articles matching the given category and keyword.
 */
fun filterArticles(articles: List<Map<String, String>>, category: String, keyword: String): List<Map<String, String>> {
/**
 * This function filters out articles based on a given category and keyword.
 *
 * @param articles A list of dictionaries representing articles.
 * @param category The category of articles to filter.
 * @param keyword The keyword to search for in the articles' titles.
 * @return A filtered list of articles matching the given category and keyword.
 */
fun filterArticles(articles: List<Map<String, String>>, category: String, keyword: String): List<Map<String, String>> {

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

    for (article in articles) {
        if (article.containsKey("category") && article["category"] == category) {
            if (article.containsKey("title") && keyword in article["title"]!!) {
                filteredArticles.add(article)
            }
        }
    }

    return filteredArticles
}