/**
 * Given a nested dictionary of nurses and their assigned shifts,
 * access and print the shift for each nurse using nested while loops.
 *
 * @param nurses A dictionary mapping nurse names to their assigned shifts.
 */
fun accessNestedDictItems(nurses: Map<String, List<String>>) {

    val nurseNames = nurses.keys.toList()  // Get the list of nurse names

    var i = 0
    while (i < nurseNames.size) {  // Iterate over each nurse's name
        val nurseName = nurseNames[i]

        // Access the list of shifts corresponding to the current nurse's name
        var j = 0
        val nurseShifts = nurses[nurseName]!!
        while (j < nurseShifts.size) {  // Iterate over each shift for the current nurse
            val shift = nurseShifts[j]

            println("Nurse $nurseName has shift: $shift")

            j++
        }

        i++
    }
}

// Example usage and output
/**
 * Given a nested dictionary of nurses and their assigned shifts,
 * access and print the shift for each nurse using nested while loops.
 *
 * @param nurses A dictionary mapping nurse names to their assigned shifts.
 */
fun accessNestedDictItems(nurses: Map<String, List<String>>) {
/**
 * Given a nested dictionary of nurses and their assigned shifts,
 * access and print the shift for each nurse using nested while loops.
 *
 * @param nurses A dictionary mapping nurse names to their assigned shifts.
 */
fun accessNestedDictItems(nurses: Map<String, List<String>>) {

    val nurseNames = nurses.keys.toList()  // Get the list of nurse names

    var i = 0
    while (i < nurseNames.size) {  // Iterate over each nurse's name
        val nurseName = nurseNames[i]

        // Access the list of shifts corresponding to the current nurse's name
        var j = 0
        val nurseShifts = nurses[nurseName]!!
        while (j < nurseShifts.size) {  // Iterate over each shift for the current nurse
            val shift = nurseShifts[j]

            println("Nurse $nurseName has shift: $shift")

            j++
        }

        i++
    }
}

// Example usage and output