/**
 * Given a list of book titles and the name of an author, return a string
 * containing the titles of books authored by the specified author.
 */
fun findBooksByAuthor(books: List<String>, author: String): String {

    val booksByAuthor = mutableListOf<String>()

    for (bookTitle in books) {
        val words = bookTitle.split(" ")

        if (author in words) {
            booksByAuthor.add(bookTitle)
        }
    }

    return booksByAuthor.joinToString(", ")
}
/**
 * Given a list of book titles and the name of an author, return a string
 * containing the titles of books authored by the specified author.
 */
fun findBooksByAuthor(books: List<String>, author: String): String {
/**
 * Given a list of book titles and the name of an author, return a string
 * containing the titles of books authored by the specified author.
 */
fun findBooksByAuthor(books: List<String>, author: String): String {

    val booksByAuthor = mutableListOf<String>()

    for (bookTitle in books) {
        val words = bookTitle.split(" ")

        if (author in words) {
            booksByAuthor.add(bookTitle)
        }
    }

    return booksByAuthor.joinToString(", ")
}