/**
 * Finds the interior designers who have experience working with specific types of interiors.
 *
 * @param interiors A list of tuples, where each tuple contains the interior type as the first element and a list of
 * designers who have experience working with that interior type as the second element.
 * @return A list of interior designers who have experience working with all the given interior types.
 *
 * Example:
 * getInteriorDesigners(listOf(
 *     Pair("Living Room", listOf("Designer A", "Designer B", "Designer C")),
 *     Pair("Bedroom", listOf("Designer B", "Designer C", "Designer D")),
 *     Pair("Kitchen", listOf("Designer A", "Designer C", "Designer E")),
 *     Pair("Bathroom", listOf("Designer B", "Designer E"))
 * ))
 * Output: ['Designer C']
 */
fun getInteriorDesigners(interiors: List<Pair<String, List<String>>>): List<String> {

    val designers = mutableSetOf<String>()
    for (interior in interiors) {
        designers.addAll(interior.second)
    }

    var commonDesigners = designers.toList()
    for (interior in interiors) {
        commonDesigners = commonDesigners.intersect(interior.second).toList()
    }

    return commonDesigners
}
/**
 * Finds the interior designers who have experience working with specific types of interiors.
 *
 * @param interiors A list of tuples, where each tuple contains the interior type as the first element and a list of
 * designers who have experience working with that interior type as the second element.
 * @return A list of interior designers who have experience working with all the given interior types.
 *
 * Example:
 * getInteriorDesigners(listOf(
 *     Pair("Living Room", listOf("Designer A", "Designer B", "Designer C")),
 *     Pair("Bedroom", listOf("Designer B", "Designer C", "Designer D")),
 *     Pair("Kitchen", listOf("Designer A", "Designer C", "Designer E")),
 *     Pair("Bathroom", listOf("Designer B", "Designer E"))
 * ))
 * Output: ['Designer C']
 */
fun getInteriorDesigners(interiors: List<Pair<String, List<String>>>): List<String> {
/**
 * Finds the interior designers who have experience working with specific types of interiors.
 *
 * @param interiors A list of tuples, where each tuple contains the interior type as the first element and a list of
 * designers who have experience working with that interior type as the second element.
 * @return A list of interior designers who have experience working with all the given interior types.
 *
 * Example:
 * getInteriorDesigners(listOf(
 *     Pair("Living Room", listOf("Designer A", "Designer B", "Designer C")),
 *     Pair("Bedroom", listOf("Designer B", "Designer C", "Designer D")),
 *     Pair("Kitchen", listOf("Designer A", "Designer C", "Designer E")),
 *     Pair("Bathroom", listOf("Designer B", "Designer E"))
 * ))
 * Output: ['Designer C']
 */
fun getInteriorDesigners(interiors: List<Pair<String, List<String>>>): List<String> {

    val designers = mutableSetOf<String>()
    for (interior in interiors) {
        designers.addAll(interior.second)
    }

    var commonDesigners = designers.toList()
    for (interior in interiors) {
        commonDesigners = commonDesigners.intersect(interior.second).toList()
    }

    return commonDesigners
}