/**
 * This function returns a list containing the common areas between two geographical dictionaries.
 *
 * @param geography1 A dictionary representing the first geographical area with area names as keys.
 * @param geography2 A dictionary representing the second geographical area with area names as keys.
 * @return A list of the common areas between the two geographical dictionaries.
 *
 * Example:
 * val japan = mapOf("Tokyo" to 131890, "Osaka" to 55239, "Kyoto" to 82785, "Hokkaido" to 78421)
 * val china = mapOf("Beijing" to 16410, "Shanghai" to 6340, "Chongqing" to 82306, "Hangzhou" to 16520)
 * findCommonAreas(japan, china) // Output: ['Hangzhou']
 */
fun findCommonAreas(geography1: Map<String, Int>, geography2: Map<String, Int>): List<String> {

    val commonAreas = mutableListOf<String>()

    for ((area, population) in geography1) {
        if (geography2.containsKey(area) && population > geography2.getValue(area)) {
            commonAreas.add(area)
        }
    }

    return commonAreas
}
/**
 * This function returns a list containing the common areas between two geographical dictionaries.
 *
 * @param geography1 A dictionary representing the first geographical area with area names as keys.
 * @param geography2 A dictionary representing the second geographical area with area names as keys.
 * @return A list of the common areas between the two geographical dictionaries.
 *
 * Example:
 * val japan = mapOf("Tokyo" to 131890, "Osaka" to 55239, "Kyoto" to 82785, "Hokkaido" to 78421)
 * val china = mapOf("Beijing" to 16410, "Shanghai" to 6340, "Chongqing" to 82306, "Hangzhou" to 16520)
 * findCommonAreas(japan, china) // Output: ['Hangzhou']
 */
fun findCommonAreas(geography1: Map<String, Int>, geography2: Map<String, Int>): List<String> {
/**
 * This function returns a list containing the common areas between two geographical dictionaries.
 *
 * @param geography1 A dictionary representing the first geographical area with area names as keys.
 * @param geography2 A dictionary representing the second geographical area with area names as keys.
 * @return A list of the common areas between the two geographical dictionaries.
 *
 * Example:
 * val japan = mapOf("Tokyo" to 131890, "Osaka" to 55239, "Kyoto" to 82785, "Hokkaido" to 78421)
 * val china = mapOf("Beijing" to 16410, "Shanghai" to 6340, "Chongqing" to 82306, "Hangzhou" to 16520)
 * findCommonAreas(japan, china) // Output: ['Hangzhou']
 */
fun findCommonAreas(geography1: Map<String, Int>, geography2: Map<String, Int>): List<String> {

    val commonAreas = mutableListOf<String>()

    for ((area, population) in geography1) {
        if (geography2.containsKey(area) && population > geography2.getValue(area)) {
            commonAreas.add(area)
        }
    }

    return commonAreas
}