/**
 * Given two nested dictionaries, find the common values present in both dictionaries.
 */
fun findCommonValues(nestedDict1: Map<String, Any>, nestedDict2: Map<String, Any>): List<Any> {

    val commonValues = mutableListOf<Any>()
    for ((key1, value1) in nestedDict1) {
        if (value1 is Map<*, *> && nestedDict2[key1] is Map<*, *>) {
            commonValues.addAll(findCommonValues(value1 as Map<String, Any>, nestedDict2[key1] as Map<String, Any>))
        } else if (nestedDict2[key1] == value1) {
            commonValues.add(value1)
        }
    }
    return commonValues
}
/**
 * Given two nested dictionaries, find the common values present in both dictionaries.
 */
fun findCommonValues(nestedDict1: Map<String, Any>, nestedDict2: Map<String, Any>): List<Any> {
/**
 * Given two nested dictionaries, find the common values present in both dictionaries.
 */
fun findCommonValues(nestedDict1: Map<String, Any>, nestedDict2: Map<String, Any>): List<Any> {

    val commonValues = mutableListOf<Any>()
    for ((key1, value1) in nestedDict1) {
        if (value1 is Map<*, *> && nestedDict2[key1] is Map<*, *>) {
            commonValues.addAll(findCommonValues(value1 as Map<String, Any>, nestedDict2[key1] as Map<String, Any>))
        } else if (nestedDict2[key1] == value1) {
            commonValues.add(value1)
        }
    }
    return commonValues
}