/**
 * This function takes a set of building edges and a set of roads, and finds the common edges between them.
 *
 * @param buildingEdges A set of edges in a building.
 * @param roads A set of roads.
 * @return A set of common edges between building and roads.
 */
fun findCommonEdges(buildingEdges: Set<Int>, roads: Set<Set<Int>>): Set<Int> {

    val commonEdges = mutableSetOf<Int>()
    for (buildingEdge in buildingEdges) {
        for (road in roads) {
            val roadEdges = road.toSet()
            if (buildingEdge in roadEdges) {
                commonEdges.add(buildingEdge)
                break  // Break loop as we have already found a common edge for this building edge
            }
        }
    }
    return commonEdges
}
/**
 * This function takes a set of building edges and a set of roads, and finds the common edges between them.
 *
 * @param buildingEdges A set of edges in a building.
 * @param roads A set of roads.
 * @return A set of common edges between building and roads.
 */
fun findCommonEdges(buildingEdges: Set<Int>, roads: Set<Set<Int>>): Set<Int> {
/**
 * This function takes a set of building edges and a set of roads, and finds the common edges between them.
 *
 * @param buildingEdges A set of edges in a building.
 * @param roads A set of roads.
 * @return A set of common edges between building and roads.
 */
fun findCommonEdges(buildingEdges: Set<Int>, roads: Set<Set<Int>>): Set<Int> {

    val commonEdges = mutableSetOf<Int>()
    for (buildingEdge in buildingEdges) {
        for (road in roads) {
            val roadEdges = road.toSet()
            if (buildingEdge in roadEdges) {
                commonEdges.add(buildingEdge)
                break  // Break loop as we have already found a common edge for this building edge
            }
        }
    }
    return commonEdges
}