/**
 * This exercise requires looping through sets of journalists and articles to find the intersection.
 *
 * @param journalists set of journalists' names (String)
 * @param articles set of article titles (String)
 * @return result tuple of (journalist, article) pairs found in both sets
 */
fun loopAndTuple(journalists: Set<String>, articles: Set<String>): List<Pair<String, String>> {

    // Initialize an empty list to store the intersection tuples
    val intersect = mutableListOf<Pair<String, String>>()

    // Loop through each journalist
    for (journalist in journalists) {
        // Loop through each article
        for (article in articles) {
            // Check if the journalist and article pair is in both sets
            if (Pair(journalist, article) in journalists.zip(articles)) {
                // Append the found pair to the intersection list as a tuple
                intersect.add(Pair(journalist, article))
            }
        }
    }

    return intersect
}
/**
 * This exercise requires looping through sets of journalists and articles to find the intersection.
 *
 * @param journalists set of journalists' names (String)
 * @param articles set of article titles (String)
 * @return result tuple of (journalist, article) pairs found in both sets
 */
fun loopAndTuple(journalists: Set<String>, articles: Set<String>): List<Pair<String, String>> {
/**
 * This exercise requires looping through sets of journalists and articles to find the intersection.
 *
 * @param journalists set of journalists' names (String)
 * @param articles set of article titles (String)
 * @return result tuple of (journalist, article) pairs found in both sets
 */
fun loopAndTuple(journalists: Set<String>, articles: Set<String>): List<Pair<String, String>> {

    // Initialize an empty list to store the intersection tuples
    val intersect = mutableListOf<Pair<String, String>>()

    // Loop through each journalist
    for (journalist in journalists) {
        // Loop through each article
        for (article in articles) {
            // Check if the journalist and article pair is in both sets
            if (Pair(journalist, article) in journalists.zip(articles)) {
                // Append the found pair to the intersection list as a tuple
                intersect.add(Pair(journalist, article))
            }
        }
    }

    return intersect
}