/**
 * This function finds the intersection of two sets of coordinates.
 *
 * @param coordinates1 The first set of coordinates as a list of tuples.
 * @param coordinates2 The second set of coordinates as a list of tuples.
 * @return The intersection of the two sets of coordinates.
 */
fun findIntersection(coordinates1: List<Pair<Int, Int>>, coordinates2: List<Pair<Int, Int>>): List<Pair<Int, Int>> {

    val intersection = mutableListOf<Pair<Int, Int>>()
    for (coord1 in coordinates1) {
        for (coord2 in coordinates2) {
            if (coord1 == coord2) {
                intersection.add(coord1)
                break
            }
        }
    }
    return intersection
}
/**
 * This function finds the intersection of two sets of coordinates.
 *
 * @param coordinates1 The first set of coordinates as a list of tuples.
 * @param coordinates2 The second set of coordinates as a list of tuples.
 * @return The intersection of the two sets of coordinates.
 */
fun findIntersection(coordinates1: List<Pair<Int, Int>>, coordinates2: List<Pair<Int, Int>>): List<Pair<Int, Int>> {
/**
 * This function finds the intersection of two sets of coordinates.
 *
 * @param coordinates1 The first set of coordinates as a list of tuples.
 * @param coordinates2 The second set of coordinates as a list of tuples.
 * @return The intersection of the two sets of coordinates.
 */
fun findIntersection(coordinates1: List<Pair<Int, Int>>, coordinates2: List<Pair<Int, Int>>): List<Pair<Int, Int>> {

    val intersection = mutableListOf<Pair<Int, Int>>()
    for (coord1 in coordinates1) {
        for (coord2 in coordinates2) {
            if (coord1 == coord2) {
                intersection.add(coord1)
                break
            }
        }
    }
    return intersection
}