/**
 * This function takes a dictionary of articles and a keyword as input, and returns a list of article titles that contain the keyword.
 *
 * @param data A dictionary where the keys are article titles and the values are article contents.
 * @param keyword The keyword to search within the article contents.
 * @return A list of relevant article titles that contain the keyword.
 */
fun findRelevantArticles(data: Map<String, String>, keyword: String): List<String> {

    val relevantArticles = mutableListOf<String>()

    // Loop through each article title in the dictionary
    for ((title, articleContent) in data) {
        // Check if the keyword exists in the article content
        if (keyword in articleContent) {
            // Add the article title to the relevantArticles list if keyword found
            relevantArticles.add(title)
        }
    }

    return relevantArticles
}

// Example usage
val articles = mapOf(
    "Article 1" to "This is a sample article containing relevant information.",
    "Article 2" to "This is another article with interesting facts.",
    "Article 3" to "Here is an article that talks about technology advancements."
)

val searchKeyword = "technology"

val relevantArticles = findRelevantArticles(articles, searchKeyword)
/**
 * This function takes a dictionary of articles and a keyword as input, and returns a list of article titles that contain the keyword.
 *
 * @param data A dictionary where the keys are article titles and the values are article contents.
 * @param keyword The keyword to search within the article contents.
 * @return A list of relevant article titles that contain the keyword.
 */
fun findRelevantArticles(data: Map<String, String>, keyword: String): List<String> {
/**
 * This function takes a dictionary of articles and a keyword as input, and returns a list of article titles that contain the keyword.
 *
 * @param data A dictionary where the keys are article titles and the values are article contents.
 * @param keyword The keyword to search within the article contents.
 * @return A list of relevant article titles that contain the keyword.
 */
fun findRelevantArticles(data: Map<String, String>, keyword: String): List<String> {

    val relevantArticles = mutableListOf<String>()

    // Loop through each article title in the dictionary
    for ((title, articleContent) in data) {
        // Check if the keyword exists in the article content
        if (keyword in articleContent) {
            // Add the article title to the relevantArticles list if keyword found
            relevantArticles.add(title)
        }
    }

    return relevantArticles
}

// Example usage
val articles = mapOf(
    "Article 1" to "This is a sample article containing relevant information.",
    "Article 2" to "This is another article with interesting facts.",
    "Article 3" to "Here is an article that talks about technology advancements."
)

val searchKeyword = "technology"

val relevantArticles = findRelevantArticles(articles, searchKeyword)