/**
 * This function takes a list of library books and a genre as input,
 * and returns a list containing the books with matching genre.
 *
 * @param libraryBooks List of books in the library.
 * @param genre Genre of the books to search for.
 * @return List containing books with matching genre.
 * If no books match the genre, an empty list is returned.
 */
fun findBooksByGenre(libraryBooks: List<List<String>>, genre: String): List<List<String>> {

    val matchingBooks = mutableListOf<List<String>>()
    for (book in libraryBooks) {
        if (book[2] == genre) {
            matchingBooks.add(book)
        }
    }
    return matchingBooks
}
/**
 * This function takes a list of library books and a genre as input,
 * and returns a list containing the books with matching genre.
 *
 * @param libraryBooks List of books in the library.
 * @param genre Genre of the books to search for.
 * @return List containing books with matching genre.
 * If no books match the genre, an empty list is returned.
 */
fun findBooksByGenre(libraryBooks: List<List<String>>, genre: String): List<List<String>> {
/**
 * This function takes a list of library books and a genre as input,
 * and returns a list containing the books with matching genre.
 *
 * @param libraryBooks List of books in the library.
 * @param genre Genre of the books to search for.
 * @return List containing books with matching genre.
 * If no books match the genre, an empty list is returned.
 */
fun findBooksByGenre(libraryBooks: List<List<String>>, genre: String): List<List<String>> {

    val matchingBooks = mutableListOf<List<String>>()
    for (book in libraryBooks) {
        if (book[2] == genre) {
            matchingBooks.add(book)
        }
    }
    return matchingBooks
}