/**
 * Given two lists of geographical areas, find the intersection between them.
 *
 * @param areas1 The first list of geographical areas.
 * @param areas2 The second list of geographical areas.
 * @return The list of geographical areas that exist in both areas1 and areas2.
 *
 * Example:
 * intersection(listOf("City A", "City B", "City C"), listOf("City B", "City C", "City D"))
 * Output: ['City B', 'City C']
 */
fun intersection(areas1: List<String>, areas2: List<String>): List<String> {

    val intersectionAreas = mutableListOf<String>()
    for (area in areas1) {
        if (area in areas2) {
            intersectionAreas.add(area)
        }
    }
    return intersectionAreas
}
/**
 * Given two lists of geographical areas, find the intersection between them.
 *
 * @param areas1 The first list of geographical areas.
 * @param areas2 The second list of geographical areas.
 * @return The list of geographical areas that exist in both areas1 and areas2.
 *
 * Example:
 * intersection(listOf("City A", "City B", "City C"), listOf("City B", "City C", "City D"))
 * Output: ['City B', 'City C']
 */
fun intersection(areas1: List<String>, areas2: List<String>): List<String> {
/**
 * Given two lists of geographical areas, find the intersection between them.
 *
 * @param areas1 The first list of geographical areas.
 * @param areas2 The second list of geographical areas.
 * @return The list of geographical areas that exist in both areas1 and areas2.
 *
 * Example:
 * intersection(listOf("City A", "City B", "City C"), listOf("City B", "City C", "City D"))
 * Output: ['City B', 'City C']
 */
fun intersection(areas1: List<String>, areas2: List<String>): List<String> {

    val intersectionAreas = mutableListOf<String>()
    for (area in areas1) {
        if (area in areas2) {
            intersectionAreas.add(area)
        }
    }
    return intersectionAreas
}