/**
 * This function takes a book title and a list of books as input,
 * and deletes the book with the given title from the list.
 *
 * @param title The title of the book to be deleted.
 * @param books The list of books.
 * @return The updated list of books after deleting the specified book.
 * @throws IllegalArgumentException If the book with the given title does not exist in the list.
 */
fun deleteBook(title: String, books: MutableList<Map<String, String>>): MutableList<Map<String, String>> {

    for (i in books.indices) {
        if (books[i]["title"] == title) {
            books.removeAt(i)
            return books
        }
    }
    throw IllegalArgumentException("Book not found in the list.")
}
/**
 * This function takes a book title and a list of books as input,
 * and deletes the book with the given title from the list.
 *
 * @param title The title of the book to be deleted.
 * @param books The list of books.
 * @return The updated list of books after deleting the specified book.
 * @throws IllegalArgumentException If the book with the given title does not exist in the list.
 */
fun deleteBook(title: String, books: MutableList<Map<String, String>>): MutableList<Map<String, String>> {
/**
 * This function takes a book title and a list of books as input,
 * and deletes the book with the given title from the list.
 *
 * @param title The title of the book to be deleted.
 * @param books The list of books.
 * @return The updated list of books after deleting the specified book.
 * @throws IllegalArgumentException If the book with the given title does not exist in the list.
 */
fun deleteBook(title: String, books: MutableList<Map<String, String>>): MutableList<Map<String, String>> {

    for (i in books.indices) {
        if (books[i]["title"] == title) {
            books.removeAt(i)
            return books
        }
    }
    throw IllegalArgumentException("Book not found in the list.")
}