/**
 * Given two dictionaries, find the common elements (keys and their corresponding values) between them.
 * Return the common elements as a set of tuples.
 */
fun findCommonElements(dictionary1: Map<String, Any>, dictionary2: Map<String, Any>): Set<Pair<String, Any>> {

    val commonElements = mutableSetOf<Pair<String, Any>>()

    // Loop through the first dictionary
    for ((key, value) in dictionary1) {
        // Check if the key exists in the second dictionary and has the same value
        if (dictionary2.containsKey(key) && dictionary2[key] == value) {
            // Add the key-value pair as a tuple to the set of common elements
            commonElements.add(Pair(key, value))
        }
    }

    // Loop through the second dictionary
    for ((key, value) in dictionary2) {
        // Check if the key exists in the first dictionary and has the same value
        if (dictionary1.containsKey(key) && dictionary1[key] == value) {
            // Add the key-value pair as a tuple to the set of common elements
            commonElements.add(Pair(key, value))
        }
    }

    return commonElements
}
/**
 * Given two dictionaries, find the common elements (keys and their corresponding values) between them.
 * Return the common elements as a set of tuples.
 */
fun findCommonElements(dictionary1: Map<String, Any>, dictionary2: Map<String, Any>): Set<Pair<String, Any>> {
/**
 * Given two dictionaries, find the common elements (keys and their corresponding values) between them.
 * Return the common elements as a set of tuples.
 */
fun findCommonElements(dictionary1: Map<String, Any>, dictionary2: Map<String, Any>): Set<Pair<String, Any>> {

    val commonElements = mutableSetOf<Pair<String, Any>>()

    // Loop through the first dictionary
    for ((key, value) in dictionary1) {
        // Check if the key exists in the second dictionary and has the same value
        if (dictionary2.containsKey(key) && dictionary2[key] == value) {
            // Add the key-value pair as a tuple to the set of common elements
            commonElements.add(Pair(key, value))
        }
    }

    // Loop through the second dictionary
    for ((key, value) in dictionary2) {
        // Check if the key exists in the first dictionary and has the same value
        if (dictionary1.containsKey(key) && dictionary1[key] == value) {
            // Add the key-value pair as a tuple to the set of common elements
            commonElements.add(Pair(key, value))
        }
    }

    return commonElements
}