/**
 * Given two dictionaries, find the common values present in both dictionaries.
 *
 * @param dictionary1 The first dictionary.
 * @param dictionary2 The second dictionary.
 * @return A list containing the common values.
 *
 * Example:
 * val dictionary1 = mapOf("name" to "John", "age" to 30, "occupation" to "Social Worker")
 * val dictionary2 = mapOf("name" to "Jane", "age" to 28, "occupation" to "Social Worker")
 * findCommonValues(dictionary1, dictionary2) // Output: ["Social Worker"]
 */
fun findCommonValues(dictionary1: Map<String, Any>, dictionary2: Map<String, Any>): List<Any> {

    val commonValues = mutableListOf<Any>()

    // Iterate over the values in the first dictionary
    for (value1 in dictionary1.values) {
        // Iterate over the values in the second dictionary
        for (value2 in dictionary2.values) {
            // If the values match, add it to the list of common values
            if (value1 == value2) {
                commonValues.add(value1)
            }
        }
    }

    return commonValues
}
/**
 * Given two dictionaries, find the common values present in both dictionaries.
 *
 * @param dictionary1 The first dictionary.
 * @param dictionary2 The second dictionary.
 * @return A list containing the common values.
 *
 * Example:
 * val dictionary1 = mapOf("name" to "John", "age" to 30, "occupation" to "Social Worker")
 * val dictionary2 = mapOf("name" to "Jane", "age" to 28, "occupation" to "Social Worker")
 * findCommonValues(dictionary1, dictionary2) // Output: ["Social Worker"]
 */
fun findCommonValues(dictionary1: Map<String, Any>, dictionary2: Map<String, Any>): List<Any> {
/**
 * Given two dictionaries, find the common values present in both dictionaries.
 *
 * @param dictionary1 The first dictionary.
 * @param dictionary2 The second dictionary.
 * @return A list containing the common values.
 *
 * Example:
 * val dictionary1 = mapOf("name" to "John", "age" to 30, "occupation" to "Social Worker")
 * val dictionary2 = mapOf("name" to "Jane", "age" to 28, "occupation" to "Social Worker")
 * findCommonValues(dictionary1, dictionary2) // Output: ["Social Worker"]
 */
fun findCommonValues(dictionary1: Map<String, Any>, dictionary2: Map<String, Any>): List<Any> {

    val commonValues = mutableListOf<Any>()

    // Iterate over the values in the first dictionary
    for (value1 in dictionary1.values) {
        // Iterate over the values in the second dictionary
        for (value2 in dictionary2.values) {
            // If the values match, add it to the list of common values
            if (value1 == value2) {
                commonValues.add(value1)
            }
        }
    }

    return commonValues
}