/**
 * Given two sets of cities, return a set containing the common cities.
 *
 * @param cities1 A set of cities.
 * @param cities2 Another set of cities.
 * @return A set containing the common cities.
 *
 * Example:
 * findCommonCities(setOf("Paris", "London", "Rome", "Berlin"), setOf("Berlin", "Tokyo", "Paris", "New York"))
 * // Returns: setOf("Paris", "Berlin")
 * findCommonCities(setOf("Sydney", "Madrid", "Toronto"), setOf("Tokyo", "New York", "London"))
 * // Returns: emptySet()
 */
fun findCommonCities(cities1: Set<String>, cities2: Set<String>): Set<String> {

    val commonCities = mutableSetOf<String>()
    for (city in cities1) {
        if (city in cities2) {
            commonCities.add(city)
        }
    }
    return commonCities
}
/**
 * Given two sets of cities, return a set containing the common cities.
 *
 * @param cities1 A set of cities.
 * @param cities2 Another set of cities.
 * @return A set containing the common cities.
 *
 * Example:
 * findCommonCities(setOf("Paris", "London", "Rome", "Berlin"), setOf("Berlin", "Tokyo", "Paris", "New York"))
 * // Returns: setOf("Paris", "Berlin")
 * findCommonCities(setOf("Sydney", "Madrid", "Toronto"), setOf("Tokyo", "New York", "London"))
 * // Returns: emptySet()
 */
fun findCommonCities(cities1: Set<String>, cities2: Set<String>): Set<String> {
/**
 * Given two sets of cities, return a set containing the common cities.
 *
 * @param cities1 A set of cities.
 * @param cities2 Another set of cities.
 * @return A set containing the common cities.
 *
 * Example:
 * findCommonCities(setOf("Paris", "London", "Rome", "Berlin"), setOf("Berlin", "Tokyo", "Paris", "New York"))
 * // Returns: setOf("Paris", "Berlin")
 * findCommonCities(setOf("Sydney", "Madrid", "Toronto"), setOf("Tokyo", "New York", "London"))
 * // Returns: emptySet()
 */
fun findCommonCities(cities1: Set<String>, cities2: Set<String>): Set<String> {

    val commonCities = mutableSetOf<String>()
    for (city in cities1) {
        if (city in cities2) {
            commonCities.add(city)
        }
    }
    return commonCities
}