/**
 * This function takes in three buildings represented as sets of segments and returns a list of common segments between them.
 *
 * @param building1 Set of segments representing building 1
 * @param building2 Set of segments representing building 2
 * @param building3 Set of segments representing building 3
 * @return List of common segments between all three buildings
 */
fun findCommonSegments(building1: Set<String>, building2: Set<String>, building3: Set<String>): List<String> {

    val commonSegments = mutableListOf<String>()

    for (segment1 in building1) {
        for (segment2 in building2) {
            if (segment1 == segment2) {
                for (segment3 in building3) {
                    if (segment1 == segment3) {
                        commonSegments.add(segment1)
                    }
                }
            }
        }
    }

    return commonSegments
}
/**
 * This function takes in three buildings represented as sets of segments and returns a list of common segments between them.
 *
 * @param building1 Set of segments representing building 1
 * @param building2 Set of segments representing building 2
 * @param building3 Set of segments representing building 3
 * @return List of common segments between all three buildings
 */
fun findCommonSegments(building1: Set<String>, building2: Set<String>, building3: Set<String>): List<String> {
/**
 * This function takes in three buildings represented as sets of segments and returns a list of common segments between them.
 *
 * @param building1 Set of segments representing building 1
 * @param building2 Set of segments representing building 2
 * @param building3 Set of segments representing building 3
 * @return List of common segments between all three buildings
 */
fun findCommonSegments(building1: Set<String>, building2: Set<String>, building3: Set<String>): List<String> {

    val commonSegments = mutableListOf<String>()

    for (segment1 in building1) {
        for (segment2 in building2) {
            if (segment1 == segment2) {
                for (segment3 in building3) {
                    if (segment1 == segment3) {
                        commonSegments.add(segment1)
                    }
                }
            }
        }
    }

    return commonSegments
}