/**
 * This exercise focuses on the intersection of "enumerate" and "Accessing values in dictionary".
 * The task is to find the common elements between two dictionaries by considering the keys as well as the values.
 *
 * @param dictionary1 The first input dictionary
 * @param dictionary2 The second input dictionary
 * @return A dictionary containing the common elements between the input dictionaries
 */
fun dictIntersection(dictionary1: Map<String, String>, dictionary2: Map<String, String>): Map<String, String> {

    val commonElements = mutableMapOf<String, String>()

    // Find the common keys between the two dictionaries
    val commonKeys = dictionary1.keys.intersect(dictionary2.keys)

    // Iterate over the common keys
    for (key in commonKeys) {
        // Check if the values of the keys are equal in both dictionaries
        if (dictionary1[key] == dictionary2[key]) {
            // Add the common elements to the result dictionary
            commonElements[key] = dictionary1[key]!!
        }
    }

    return commonElements
}
/**
 * This exercise focuses on the intersection of "enumerate" and "Accessing values in dictionary".
 * The task is to find the common elements between two dictionaries by considering the keys as well as the values.
 *
 * @param dictionary1 The first input dictionary
 * @param dictionary2 The second input dictionary
 * @return A dictionary containing the common elements between the input dictionaries
 */
fun dictIntersection(dictionary1: Map<String, String>, dictionary2: Map<String, String>): Map<String, String> {
/**
 * This exercise focuses on the intersection of "enumerate" and "Accessing values in dictionary".
 * The task is to find the common elements between two dictionaries by considering the keys as well as the values.
 *
 * @param dictionary1 The first input dictionary
 * @param dictionary2 The second input dictionary
 * @return A dictionary containing the common elements between the input dictionaries
 */
fun dictIntersection(dictionary1: Map<String, String>, dictionary2: Map<String, String>): Map<String, String> {

    val commonElements = mutableMapOf<String, String>()

    // Find the common keys between the two dictionaries
    val commonKeys = dictionary1.keys.intersect(dictionary2.keys)

    // Iterate over the common keys
    for (key in commonKeys) {
        // Check if the values of the keys are equal in both dictionaries
        if (dictionary1[key] == dictionary2[key]) {
            // Add the common elements to the result dictionary
            commonElements[key] = dictionary1[key]!!
        }
    }

    return commonElements
}