/**
 * This function takes a list of authors and a list of pairs representing
 * books in a library. It returns a list of books written by those authors.
 *
 * @param authorsList A list of strings representing the names of authors.
 * @param books A list of pairs. Each pair contains two elements: the first element
 * is the title of the book, and the second element is the author's name.
 *
 * @return A list of strings representing titles of books written by the specified authors.
 */
fun findBooksByAuthor(authorsList: List<String>, books: List<Pair<String, String>>): List<String> {

    val booksByAuthors = mutableListOf<String>()

    for (author in authorsList) {
        for (book in books) {
            if (book.second == author) {
                booksByAuthors.add(book.first)
            }
        }
    }

    return booksByAuthors
}
/**
 * This function takes a list of authors and a list of pairs representing
 * books in a library. It returns a list of books written by those authors.
 *
 * @param authorsList A list of strings representing the names of authors.
 * @param books A list of pairs. Each pair contains two elements: the first element
 * is the title of the book, and the second element is the author's name.
 *
 * @return A list of strings representing titles of books written by the specified authors.
 */
fun findBooksByAuthor(authorsList: List<String>, books: List<Pair<String, String>>): List<String> {
/**
 * This function takes a list of authors and a list of pairs representing
 * books in a library. It returns a list of books written by those authors.
 *
 * @param authorsList A list of strings representing the names of authors.
 * @param books A list of pairs. Each pair contains two elements: the first element
 * is the title of the book, and the second element is the author's name.
 *
 * @return A list of strings representing titles of books written by the specified authors.
 */
fun findBooksByAuthor(authorsList: List<String>, books: List<Pair<String, String>>): List<String> {

    val booksByAuthors = mutableListOf<String>()

    for (author in authorsList) {
        for (book in books) {
            if (book.second == author) {
                booksByAuthors.add(book.first)
            }
        }
    }

    return booksByAuthors
}