/**
 * This function finds the intersection of two dictionaries using the AND operator and looping through them.
 *
 * @param dictionary1 The first dictionary.
 * @param dictionary2 The second dictionary.
 * @return A new dictionary containing key-value pairs that exist in both dictionaries.
 */
fun findIntersection(dictionary1: Map<String, Int>, dictionary2: Map<String, Int>): Map<String, Int> {

    val intersection = mutableMapOf<String, Int>()
    for ((key, value) in dictionary1.filterKeys { it in dictionary2 }) {
        if (value == dictionary2[key]) {
            intersection[key] = value
        }
    }
    return intersection
}

// Example Usage
/**
 * This function finds the intersection of two dictionaries using the AND operator and looping through them.
 *
 * @param dictionary1 The first dictionary.
 * @param dictionary2 The second dictionary.
 * @return A new dictionary containing key-value pairs that exist in both dictionaries.
 */
fun findIntersection(dictionary1: Map<String, Int>, dictionary2: Map<String, Int>): Map<String, Int> {
/**
 * This function finds the intersection of two dictionaries using the AND operator and looping through them.
 *
 * @param dictionary1 The first dictionary.
 * @param dictionary2 The second dictionary.
 * @return A new dictionary containing key-value pairs that exist in both dictionaries.
 */
fun findIntersection(dictionary1: Map<String, Int>, dictionary2: Map<String, Int>): Map<String, Int> {

    val intersection = mutableMapOf<String, Int>()
    for ((key, value) in dictionary1.filterKeys { it in dictionary2 }) {
        if (value == dictionary2[key]) {
            intersection[key] = value
        }
    }
    return intersection
}

// Example Usage