/**
 * Given a dictionary of nurse shift schedules and a preferred shift,
 * find the nurses who have the preferred shift and return their names.
 *
 * @param nurseShifts A dictionary of nurse names and their shift schedules.
 * @param preferredShift The preferred shift to filter the nurses.
 * @return A list containing the names of the nurses with the preferred shift.
 */
fun nurseTimeDict(nurseShifts: Map<String, String>, preferredShift: String): List<String> {

    // Initialize an empty list to store the names of nurses with the preferred shift
    val nursesWithPreferredShift = mutableListOf<String>()

    // Loop through the nurseShifts map
    for ((nurse, shift) in nurseShifts) {
        // Check if nurse has the preferred shift
        if (shift == preferredShift) {
            // If yes, add the nurse's name to the list
            nursesWithPreferredShift.add(nurse)
        }
    }

    // Return the list of nurses with the preferred shift
    return nursesWithPreferredShift
}
/**
 * Given a dictionary of nurse shift schedules and a preferred shift,
 * find the nurses who have the preferred shift and return their names.
 *
 * @param nurseShifts A dictionary of nurse names and their shift schedules.
 * @param preferredShift The preferred shift to filter the nurses.
 * @return A list containing the names of the nurses with the preferred shift.
 */
fun nurseTimeDict(nurseShifts: Map<String, String>, preferredShift: String): List<String> {
/**
 * Given a dictionary of nurse shift schedules and a preferred shift,
 * find the nurses who have the preferred shift and return their names.
 *
 * @param nurseShifts A dictionary of nurse names and their shift schedules.
 * @param preferredShift The preferred shift to filter the nurses.
 * @return A list containing the names of the nurses with the preferred shift.
 */
fun nurseTimeDict(nurseShifts: Map<String, String>, preferredShift: String): List<String> {

    // Initialize an empty list to store the names of nurses with the preferred shift
    val nursesWithPreferredShift = mutableListOf<String>()

    // Loop through the nurseShifts map
    for ((nurse, shift) in nurseShifts) {
        // Check if nurse has the preferred shift
        if (shift == preferredShift) {
            // If yes, add the nurse's name to the list
            nursesWithPreferredShift.add(nurse)
        }
    }

    // Return the list of nurses with the preferred shift
    return nursesWithPreferredShift
}