/**
 * Given three lists - dayShift, nightShift, and offShift, determine
 * the intersection of the lists using the Kotlin ternary operator.
 *
 * Each list represents the names of nurses assigned to a specific shift.
 * Return a new list that contains the names of nurses who are assigned to
 * all three shifts.
 *
 * Example:
 * Input:
 * dayShift = listOf("Nurse1", "Nurse2", "Nurse3")
 * nightShift = listOf("Nurse3", "Nurse4", "Nurse5")
 * offShift = listOf("Nurse2", "Nurse3", "Nurse4")
 *
 * Output:
 * listOf("Nurse3")
 *
 * Explanation:
 * Nurse3 is the only nurse assigned to all three shifts.
 *
 * Note:
 * - You should solve this exercise using just a single line of code.
 * - Use the ternary operator to check if a nurse is assigned to all
 *   three shifts.
 * - You can assume that each nurse appears only once in each list.
 */
fun createShiftSchedule(dayShift: List<String>, nightShift: List<String>, offShift: List<String>): List<String> =
    dayShift.filter {
 it in nightShift && it in offShift }
/**
 * Given three lists - dayShift, nightShift, and offShift, determine
 * the intersection of the lists using the Kotlin ternary operator.
 *
 * Each list represents the names of nurses assigned to a specific shift.
 * Return a new list that contains the names of nurses who are assigned to
 * all three shifts.
 *
 * Example:
 * Input:
 * dayShift = listOf("Nurse1", "Nurse2", "Nurse3")
 * nightShift = listOf("Nurse3", "Nurse4", "Nurse5")
 * offShift = listOf("Nurse2", "Nurse3", "Nurse4")
 *
 * Output:
 * listOf("Nurse3")
 *
 * Explanation:
 * Nurse3 is the only nurse assigned to all three shifts.
 *
 * Note:
 * - You should solve this exercise using just a single line of code.
 * - Use the ternary operator to check if a nurse is assigned to all
 *   three shifts.
 * - You can assume that each nurse appears only once in each list.
 */
fun createShiftSchedule(dayShift: List<String>, nightShift: List<String>, offShift: List<String>): List<String> =
    dayShift.filter {
/**
 * Given three lists - dayShift, nightShift, and offShift, determine
 * the intersection of the lists using the Kotlin ternary operator.
 *
 * Each list represents the names of nurses assigned to a specific shift.
 * Return a new list that contains the names of nurses who are assigned to
 * all three shifts.
 *
 * Example:
 * Input:
 * dayShift = listOf("Nurse1", "Nurse2", "Nurse3")
 * nightShift = listOf("Nurse3", "Nurse4", "Nurse5")
 * offShift = listOf("Nurse2", "Nurse3", "Nurse4")
 *
 * Output:
 * listOf("Nurse3")
 *
 * Explanation:
 * Nurse3 is the only nurse assigned to all three shifts.
 *
 * Note:
 * - You should solve this exercise using just a single line of code.
 * - Use the ternary operator to check if a nurse is assigned to all
 *   three shifts.
 * - You can assume that each nurse appears only once in each list.
 */
fun createShiftSchedule(dayShift: List<String>, nightShift: List<String>, offShift: List<String>): List<String> =
    dayShift.filter {
 it in nightShift && it in offShift }