/**
 * Extract the articles written by a specific journalist from a list of articles.
 *
 * @param journalists A list of journalist names.
 * @param articles A list of article titles.
 * @param index The index of the journalist to filter the articles.
 * @return A list containing the articles written by the specified journalist.
 */
fun extractArticles(journalists: List<String>, articles: List<String>, index: Int): List<String> {

    val selectedArticles = mutableListOf<String>()
    for (i in journalists.indices) {
        if (i < articles.size && journalists[i] == journalists[index]) {
            selectedArticles.add(articles[i])
        }
    }
    return selectedArticles
}
/**
 * Extract the articles written by a specific journalist from a list of articles.
 *
 * @param journalists A list of journalist names.
 * @param articles A list of article titles.
 * @param index The index of the journalist to filter the articles.
 * @return A list containing the articles written by the specified journalist.
 */
fun extractArticles(journalists: List<String>, articles: List<String>, index: Int): List<String> {
/**
 * Extract the articles written by a specific journalist from a list of articles.
 *
 * @param journalists A list of journalist names.
 * @param articles A list of article titles.
 * @param index The index of the journalist to filter the articles.
 * @return A list containing the articles written by the specified journalist.
 */
fun extractArticles(journalists: List<String>, articles: List<String>, index: Int): List<String> {

    val selectedArticles = mutableListOf<String>()
    for (i in journalists.indices) {
        if (i < articles.size && journalists[i] == journalists[index]) {
            selectedArticles.add(articles[i])
        }
    }
    return selectedArticles
}