/**
 * Given a list of pairs representing the books in a library, return a list of books that are available
 * (i.e., have more than zero copies available).
 *
 * @param library A list of pairs where each pair contains a book title (String) and the number of copies available (Int).
 * @return A list of book titles (String) that are available.
 *
 * Example:
 * > availableBooks(listOf("Python Crash Course" to 3, "Intro to Algorithms" to 0, "Clean Code" to 2))
 * Outcome: ["Python Crash Course", "Clean Code"]
 */
fun availableBooks(library: List<Pair<String, Int>>): List<String> {

    return library.filter { it.second > 0 }.map { it.first }
}
/**
 * Given a list of pairs representing the books in a library, return a list of books that are available
 * (i.e., have more than zero copies available).
 *
 * @param library A list of pairs where each pair contains a book title (String) and the number of copies available (Int).
 * @return A list of book titles (String) that are available.
 *
 * Example:
 * > availableBooks(listOf("Python Crash Course" to 3, "Intro to Algorithms" to 0, "Clean Code" to 2))
 * Outcome: ["Python Crash Course", "Clean Code"]
 */
fun availableBooks(library: List<Pair<String, Int>>): List<String> {
/**
 * Given a list of pairs representing the books in a library, return a list of books that are available
 * (i.e., have more than zero copies available).
 *
 * @param library A list of pairs where each pair contains a book title (String) and the number of copies available (Int).
 * @return A list of book titles (String) that are available.
 *
 * Example:
 * > availableBooks(listOf("Python Crash Course" to 3, "Intro to Algorithms" to 0, "Clean Code" to 2))
 * Outcome: ["Python Crash Course", "Clean Code"]
 */
fun availableBooks(library: List<Pair<String, Int>>): List<String> {

    return library.filter { it.second > 0 }.map { it.first }
}