/**
 * Take a dictionary containing information about an article and a dictionary containing information about a journalist.
 * Check if the journalist has written any articles assigned topic in the given article.
 *
 * @param articleInfo A dictionary containing information about an article.
 * @param journalistInfo A dictionary containing information about a journalist.
 * @return True if the journalist has written any articles assigned topic in the given article, False otherwise.
 */
fun checkJournalist(articleInfo: Map<String, Any>, journalistInfo: Map<String, Any>): Boolean {

    // Extract the assigned topic from the article information
    val articleTopic = articleInfo["topic"]

    // Check if the journalist information has the 'articles' key
    if ("articles" in journalistInfo) {
        // Iterate over the articles written by the journalist
        for (article in journalistInfo["articles"] as List<Map<String, Any>>) {
            if ("topics" in article) {
                // Check if the assigned topic of the current article matches the given article's topic
                if (articleTopic in article["topics"] as List<*>) {
                    return true
                }
            }
        }
    }
    return false
}
/**
 * Take a dictionary containing information about an article and a dictionary containing information about a journalist.
 * Check if the journalist has written any articles assigned topic in the given article.
 *
 * @param articleInfo A dictionary containing information about an article.
 * @param journalistInfo A dictionary containing information about a journalist.
 * @return True if the journalist has written any articles assigned topic in the given article, False otherwise.
 */
fun checkJournalist(articleInfo: Map<String, Any>, journalistInfo: Map<String, Any>): Boolean {
/**
 * Take a dictionary containing information about an article and a dictionary containing information about a journalist.
 * Check if the journalist has written any articles assigned topic in the given article.
 *
 * @param articleInfo A dictionary containing information about an article.
 * @param journalistInfo A dictionary containing information about a journalist.
 * @return True if the journalist has written any articles assigned topic in the given article, False otherwise.
 */
fun checkJournalist(articleInfo: Map<String, Any>, journalistInfo: Map<String, Any>): Boolean {

    // Extract the assigned topic from the article information
    val articleTopic = articleInfo["topic"]

    // Check if the journalist information has the 'articles' key
    if ("articles" in journalistInfo) {
        // Iterate over the articles written by the journalist
        for (article in journalistInfo["articles"] as List<Map<String, Any>>) {
            if ("topics" in article) {
                // Check if the assigned topic of the current article matches the given article's topic
                if (articleTopic in article["topics"] as List<*>) {
                    return true
                }
            }
        }
    }
    return false
}