/**
 * You are given two dictionaries, dictionary1 and dictionary2, each containing key-value pairs.
 * Your task is to find and return a new dictionary that contains only the key-value pairs that are common in both dictionaries.
 * The new dictionary should only contain the common key-value pairs from the original dictionaries.
 *
 * @param dictionary1 The first dictionary containing key-value pairs
 * @param dictionary2 The second dictionary containing key-value pairs
 * @return A new dictionary containing only the common key-value pairs from both dictionaries
 */
fun findIntersection(dictionary1: Map<String, String>, dictionary2: Map<String, String>): Map<String, String> {

    // Initialize an empty dictionary to store the common key-value pairs
    val intersection = mutableMapOf<String, String>()

    // Iterate over each key-value pair in dictionary1
    for ((key, value) in dictionary1) {
        // Check if the key exists in dictionary2 and the corresponding value matches
        if (dictionary2.containsKey(key) && dictionary2[key] == value) {
            // Add the key-value pair to the intersection dictionary
            intersection[key] = value
        }
    }

    return intersection
}
/**
 * You are given two dictionaries, dictionary1 and dictionary2, each containing key-value pairs.
 * Your task is to find and return a new dictionary that contains only the key-value pairs that are common in both dictionaries.
 * The new dictionary should only contain the common key-value pairs from the original dictionaries.
 *
 * @param dictionary1 The first dictionary containing key-value pairs
 * @param dictionary2 The second dictionary containing key-value pairs
 * @return A new dictionary containing only the common key-value pairs from both dictionaries
 */
fun findIntersection(dictionary1: Map<String, String>, dictionary2: Map<String, String>): Map<String, String> {
/**
 * You are given two dictionaries, dictionary1 and dictionary2, each containing key-value pairs.
 * Your task is to find and return a new dictionary that contains only the key-value pairs that are common in both dictionaries.
 * The new dictionary should only contain the common key-value pairs from the original dictionaries.
 *
 * @param dictionary1 The first dictionary containing key-value pairs
 * @param dictionary2 The second dictionary containing key-value pairs
 * @return A new dictionary containing only the common key-value pairs from both dictionaries
 */
fun findIntersection(dictionary1: Map<String, String>, dictionary2: Map<String, String>): Map<String, String> {

    // Initialize an empty dictionary to store the common key-value pairs
    val intersection = mutableMapOf<String, String>()

    // Iterate over each key-value pair in dictionary1
    for ((key, value) in dictionary1) {
        // Check if the key exists in dictionary2 and the corresponding value matches
        if (dictionary2.containsKey(key) && dictionary2[key] == value) {
            // Add the key-value pair to the intersection dictionary
            intersection[key] = value
        }
    }

    return intersection
}