/**
 * Given two dictionaries representing city information,
 * find the common cities between them and return a list containing
 * the intersection of modifying dictionary items and slicing tuples.
 *
 * @param cityInfo1 A dictionary containing city information.
 * @param cityInfo2 A dictionary containing city information.
 * @return A list containing the common cities.
 *
 * Example:
 * val cityInfo1 = mapOf("New York" to "USA", "Tokyo" to "Japan", "Sydney" to "Australia")
 * val cityInfo2 = mapOf("Tokyo" to "Japan", "Paris" to "France", "New York" to "USA")
 * findCommonCities(cityInfo1, cityInfo2) -> listOf("Tokyo", "New York")
 */
fun findCommonCities(cityInfo1: Map<String, String>, cityInfo2: Map<String, String>): List<String> {

    val commonCities = mutableListOf<String>()

    for (city in cityInfo1.keys) {
        if (cityInfo2.containsKey(city)) {
            commonCities.add(city)
        }
    }

    return commonCities
}
/**
 * Given two dictionaries representing city information,
 * find the common cities between them and return a list containing
 * the intersection of modifying dictionary items and slicing tuples.
 *
 * @param cityInfo1 A dictionary containing city information.
 * @param cityInfo2 A dictionary containing city information.
 * @return A list containing the common cities.
 *
 * Example:
 * val cityInfo1 = mapOf("New York" to "USA", "Tokyo" to "Japan", "Sydney" to "Australia")
 * val cityInfo2 = mapOf("Tokyo" to "Japan", "Paris" to "France", "New York" to "USA")
 * findCommonCities(cityInfo1, cityInfo2) -> listOf("Tokyo", "New York")
 */
fun findCommonCities(cityInfo1: Map<String, String>, cityInfo2: Map<String, String>): List<String> {
/**
 * Given two dictionaries representing city information,
 * find the common cities between them and return a list containing
 * the intersection of modifying dictionary items and slicing tuples.
 *
 * @param cityInfo1 A dictionary containing city information.
 * @param cityInfo2 A dictionary containing city information.
 * @return A list containing the common cities.
 *
 * Example:
 * val cityInfo1 = mapOf("New York" to "USA", "Tokyo" to "Japan", "Sydney" to "Australia")
 * val cityInfo2 = mapOf("Tokyo" to "Japan", "Paris" to "France", "New York" to "USA")
 * findCommonCities(cityInfo1, cityInfo2) -> listOf("Tokyo", "New York")
 */
fun findCommonCities(cityInfo1: Map<String, String>, cityInfo2: Map<String, String>): List<String> {

    val commonCities = mutableListOf<String>()

    for (city in cityInfo1.keys) {
        if (cityInfo2.containsKey(city)) {
            commonCities.add(city)
        }
    }

    return commonCities
}