/**
 * Given two cities and a list of coordinates, find the intersection point(s) of the two cities on the map.
 *
 * @param cityA Name of the first city
 * @param cityB Name of the second city
 * @param coordinates List of tuple coordinates in the format [(latitude, longitude)]
 * @return List of tuples containing the intersection point(s) in the format [(latitude, longitude)]
 */
fun findIntersectingPoints(cityA: String, cityB: String, coordinates: List<Pair<Double, Double>>): List<Pair<Double, Double>> {

    val intersectionPoints = mutableListOf<Pair<Double, Double>>()

    for (i in coordinates.indices) {
        for (j in coordinates.indices) {
            if (i != j) {
                // Check if the latitude of both cities intersect
                if (coordinates[i].first == coordinates[j].first) {
                    // Check if the longitude of both cities intersect
                    if (coordinates[i].second == coordinates[j].second) {
                        intersectionPoints.add(Pair(coordinates[i].first, coordinates[i].second))
                        // Add break statement here
                        break
                    }
                }
            }
        }
    }

    return intersectionPoints
}
/**
 * Given two cities and a list of coordinates, find the intersection point(s) of the two cities on the map.
 *
 * @param cityA Name of the first city
 * @param cityB Name of the second city
 * @param coordinates List of tuple coordinates in the format [(latitude, longitude)]
 * @return List of tuples containing the intersection point(s) in the format [(latitude, longitude)]
 */
fun findIntersectingPoints(cityA: String, cityB: String, coordinates: List<Pair<Double, Double>>): List<Pair<Double, Double>> {
/**
 * Given two cities and a list of coordinates, find the intersection point(s) of the two cities on the map.
 *
 * @param cityA Name of the first city
 * @param cityB Name of the second city
 * @param coordinates List of tuple coordinates in the format [(latitude, longitude)]
 * @return List of tuples containing the intersection point(s) in the format [(latitude, longitude)]
 */
fun findIntersectingPoints(cityA: String, cityB: String, coordinates: List<Pair<Double, Double>>): List<Pair<Double, Double>> {

    val intersectionPoints = mutableListOf<Pair<Double, Double>>()

    for (i in coordinates.indices) {
        for (j in coordinates.indices) {
            if (i != j) {
                // Check if the latitude of both cities intersect
                if (coordinates[i].first == coordinates[j].first) {
                    // Check if the longitude of both cities intersect
                    if (coordinates[i].second == coordinates[j].second) {
                        intersectionPoints.add(Pair(coordinates[i].first, coordinates[i].second))
                        // Add break statement here
                        break
                    }
                }
            }
        }
    }

    return intersectionPoints
}