/**
 * A librarian wants to display all the books in the library. However, the books are stored in multiple shelves
 * within different sections. The librarian uses nested while loops and a for loop to traverse through the shelves
 * and sections respectively, and print the titles of all the books in the library.
 *
 * @param library A dictionary representing the library, where keys are section names and values are lists of shelves.
 */
fun printLibraryBooks(library: Map<String, List<List<String>>>) {

    // Iterate through each section in the library
    for ((section, shelves) in library) {
        var shelfIndex = 0

        // Check if there are shelves in the current section
        while (shelfIndex < shelves.size) {
            val books = shelves[shelfIndex]
            var bookIndex = 0

            // Check if there are books on the current shelf
            while (bookIndex < books.size) {
                // Print the title of the book
                println(books[bookIndex])
                bookIndex++
            }
            shelfIndex++
        }
    }
}
/**
 * A librarian wants to display all the books in the library. However, the books are stored in multiple shelves
 * within different sections. The librarian uses nested while loops and a for loop to traverse through the shelves
 * and sections respectively, and print the titles of all the books in the library.
 *
 * @param library A dictionary representing the library, where keys are section names and values are lists of shelves.
 */
fun printLibraryBooks(library: Map<String, List<List<String>>>) {
/**
 * A librarian wants to display all the books in the library. However, the books are stored in multiple shelves
 * within different sections. The librarian uses nested while loops and a for loop to traverse through the shelves
 * and sections respectively, and print the titles of all the books in the library.
 *
 * @param library A dictionary representing the library, where keys are section names and values are lists of shelves.
 */
fun printLibraryBooks(library: Map<String, List<List<String>>>) {

    // Iterate through each section in the library
    for ((section, shelves) in library) {
        var shelfIndex = 0

        // Check if there are shelves in the current section
        while (shelfIndex < shelves.size) {
            val books = shelves[shelfIndex]
            var bookIndex = 0

            // Check if there are books on the current shelf
            while (bookIndex < books.size) {
                // Print the title of the book
                println(books[bookIndex])
                bookIndex++
            }
            shelfIndex++
        }
    }
}