/**
 * In a given library, find the author of a specific book title.
 *
 * @param library A map representing the library with book titles as keys and authors as values.
 * @param bookTitle The title of the book to search for.
 * @return The author of the book if found, otherwise returns null.
 *
 * Example:
 * val library = mapOf(
 *     "Book A" to "Author 1",
 *     "Book B" to "Author 2",
 *     "Book C" to "Author 3",
 *     "Book D" to "Author 4"
 * )
 * val bookTitle = "Book C"
 *
 * findBookAuthor(library, bookTitle)  // Returns "Author 3"
 */
fun findBookAuthor(library: Map<String, String>, bookTitle: String): String? {

    for ((title, author) in library) {
        if (title == bookTitle) {
            return author
        }
    }
    return null
}
/**
 * In a given library, find the author of a specific book title.
 *
 * @param library A map representing the library with book titles as keys and authors as values.
 * @param bookTitle The title of the book to search for.
 * @return The author of the book if found, otherwise returns null.
 *
 * Example:
 * val library = mapOf(
 *     "Book A" to "Author 1",
 *     "Book B" to "Author 2",
 *     "Book C" to "Author 3",
 *     "Book D" to "Author 4"
 * )
 * val bookTitle = "Book C"
 *
 * findBookAuthor(library, bookTitle)  // Returns "Author 3"
 */
fun findBookAuthor(library: Map<String, String>, bookTitle: String): String? {
/**
 * In a given library, find the author of a specific book title.
 *
 * @param library A map representing the library with book titles as keys and authors as values.
 * @param bookTitle The title of the book to search for.
 * @return The author of the book if found, otherwise returns null.
 *
 * Example:
 * val library = mapOf(
 *     "Book A" to "Author 1",
 *     "Book B" to "Author 2",
 *     "Book C" to "Author 3",
 *     "Book D" to "Author 4"
 * )
 * val bookTitle = "Book C"
 *
 * findBookAuthor(library, bookTitle)  // Returns "Author 3"
 */
fun findBookAuthor(library: Map<String, String>, bookTitle: String): String? {

    for ((title, author) in library) {
        if (title == bookTitle) {
            return author
        }
    }
    return null
}