/**
 * This function takes in a list of nurses, where each nurse is represented as a Pair containing their name and a list of shifts they work.
 * Your task is to find the common shifts that all nurses work.
 *
 * @param nurses A list of nurses
 * @return A set of common shifts that all nurses work
 */
fun findCommonElements(nurses: List<Pair<String, List<String>>>) : Set<String> {

    // Initialize a set with all the shifts of the first nurse
    var commonShifts = nurses[0].second.toSet()

    // Iterate through the rest of the nurses
    for (i in 1 until nurses.size) {
        // Create a set of shifts for each nurse
        val nurseShifts = nurses[i].second.toSet()
        // Find the intersection of common shifts with nurseShifts
        commonShifts = commonShifts.intersect(nurseShifts)
    }

    return commonShifts
}
/**
 * This function takes in a list of nurses, where each nurse is represented as a Pair containing their name and a list of shifts they work.
 * Your task is to find the common shifts that all nurses work.
 *
 * @param nurses A list of nurses
 * @return A set of common shifts that all nurses work
 */
fun findCommonElements(nurses: List<Pair<String, List<String>>>) : Set<String> {
/**
 * This function takes in a list of nurses, where each nurse is represented as a Pair containing their name and a list of shifts they work.
 * Your task is to find the common shifts that all nurses work.
 *
 * @param nurses A list of nurses
 * @return A set of common shifts that all nurses work
 */
fun findCommonElements(nurses: List<Pair<String, List<String>>>) : Set<String> {

    // Initialize a set with all the shifts of the first nurse
    var commonShifts = nurses[0].second.toSet()

    // Iterate through the rest of the nurses
    for (i in 1 until nurses.size) {
        // Create a set of shifts for each nurse
        val nurseShifts = nurses[i].second.toSet()
        // Find the intersection of common shifts with nurseShifts
        commonShifts = commonShifts.intersect(nurseShifts)
    }

    return commonShifts
}