/**
 * This function returns the book names written by the given author
 */
fun searchBooksInLibrary(booksList: List<Map<String, String>>, authorName: String): List<String> {

    val matchingBooks = mutableListOf<String>() // Create an empty list to store the matching books

    for (bookInfo in booksList) {
        for ((key, value) in bookInfo) {
            if (key == "author" && value == authorName) {
                matchingBooks.add(bookInfo["title"]!!) // Add the book to the matchingBooks list
            }
        }
    }

    return matchingBooks
}
/**
 * This function returns the book names written by the given author
 */
fun searchBooksInLibrary(booksList: List<Map<String, String>>, authorName: String): List<String> {
/**
 * This function returns the book names written by the given author
 */
fun searchBooksInLibrary(booksList: List<Map<String, String>>, authorName: String): List<String> {

    val matchingBooks = mutableListOf<String>() // Create an empty list to store the matching books

    for (bookInfo in booksList) {
        for ((key, value) in bookInfo) {
            if (key == "author" && value == authorName) {
                matchingBooks.add(bookInfo["title"]!!) // Add the book to the matchingBooks list
            }
        }
    }

    return matchingBooks
}