/**
 * Given two dictionaries, find common elements between the values of the dictionaries.
 *
 * @param dictionary1 First dictionary.
 * @param dictionary2 Second dictionary.
 * @return A list containing the common elements between the values of the dictionaries.
 */
fun findCommonElements(dictionary1: Map<String, List<Any>>, dictionary2: Map<String, List<Any>>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Iterate over the values of the first dictionary
    for ((_, value1) in dictionary1) {
        // Iterate over the values of the second dictionary
        for ((_, value2) in dictionary2) {
            // Check if the values have common elements
            if (value1.intersect(value2).isNotEmpty()) {
                // Add the common elements to the list
                commonElements.addAll(value1.intersect(value2))
            }
        }
    }

    return commonElements
}
/**
 * Given two dictionaries, find common elements between the values of the dictionaries.
 *
 * @param dictionary1 First dictionary.
 * @param dictionary2 Second dictionary.
 * @return A list containing the common elements between the values of the dictionaries.
 */
fun findCommonElements(dictionary1: Map<String, List<Any>>, dictionary2: Map<String, List<Any>>): List<Any> {
/**
 * Given two dictionaries, find common elements between the values of the dictionaries.
 *
 * @param dictionary1 First dictionary.
 * @param dictionary2 Second dictionary.
 * @return A list containing the common elements between the values of the dictionaries.
 */
fun findCommonElements(dictionary1: Map<String, List<Any>>, dictionary2: Map<String, List<Any>>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Iterate over the values of the first dictionary
    for ((_, value1) in dictionary1) {
        // Iterate over the values of the second dictionary
        for ((_, value2) in dictionary2) {
            // Check if the values have common elements
            if (value1.intersect(value2).isNotEmpty()) {
                // Add the common elements to the list
                commonElements.addAll(value1.intersect(value2))
            }
        }
    }

    return commonElements
}