/**
 * You are a geographer working on a project to map different regions. You are given a list of regions and a list of visited regions. Your task is to write a function that returns the intersection of the two lists, where the intersection consists of regions that have been visited.
 *
 * @param regions A list of all the regions
 * @param visitedRegions A list of regions that have been visited
 * @return intersectingRegions A list of regions that have been visited
 *
 * Example:
 * intersectingRegions(listOf("Region A", "Region B", "Region C", "Region D", "Region E"), listOf("Region B", "Region E"))
 * Expected Output: ["Region B", "Region E"]
 */
fun intersectingRegions(regions: List<String>, visitedRegions: List<String>): List<String> {

    val intersectingRegions = mutableListOf<String>()

    // Iterate over each region in the regions list
    for (region in regions) {
        // Check if the region is in the visitedRegions list
        if (region in visitedRegions) {
            // Add the region to the intersectingRegions list
            intersectingRegions.add(region)
        }
    }

    return intersectingRegions
}
/**
 * You are a geographer working on a project to map different regions. You are given a list of regions and a list of visited regions. Your task is to write a function that returns the intersection of the two lists, where the intersection consists of regions that have been visited.
 *
 * @param regions A list of all the regions
 * @param visitedRegions A list of regions that have been visited
 * @return intersectingRegions A list of regions that have been visited
 *
 * Example:
 * intersectingRegions(listOf("Region A", "Region B", "Region C", "Region D", "Region E"), listOf("Region B", "Region E"))
 * Expected Output: ["Region B", "Region E"]
 */
fun intersectingRegions(regions: List<String>, visitedRegions: List<String>): List<String> {
/**
 * You are a geographer working on a project to map different regions. You are given a list of regions and a list of visited regions. Your task is to write a function that returns the intersection of the two lists, where the intersection consists of regions that have been visited.
 *
 * @param regions A list of all the regions
 * @param visitedRegions A list of regions that have been visited
 * @return intersectingRegions A list of regions that have been visited
 *
 * Example:
 * intersectingRegions(listOf("Region A", "Region B", "Region C", "Region D", "Region E"), listOf("Region B", "Region E"))
 * Expected Output: ["Region B", "Region E"]
 */
fun intersectingRegions(regions: List<String>, visitedRegions: List<String>): List<String> {

    val intersectingRegions = mutableListOf<String>()

    // Iterate over each region in the regions list
    for (region in regions) {
        // Check if the region is in the visitedRegions list
        if (region in visitedRegions) {
            // Add the region to the intersectingRegions list
            intersectingRegions.add(region)
        }
    }

    return intersectingRegions
}