/**
 * Function to search the books in the library based on the given query.
 *
 * @param library A dictionary representing the library with book names as keys and quantities as values.
 * @param query The search query to be used to find relevant books.
 * @return A list of book names matching the search query.
 */
fun searchBooks(library: Map<String, Int>, query: String): List<String> {

    val matchingBooks = mutableListOf<String>()
    
    // Iterate through each book in the library
    for (book in library.keys) {
        // Check if the query is found in the book name or not
        if (query.toLowerCase() in book.toLowerCase()) {
            // Append the book name to the matching books list
            matchingBooks.add(book)
        }
    }
    
    return matchingBooks
}
/**
 * Function to search the books in the library based on the given query.
 *
 * @param library A dictionary representing the library with book names as keys and quantities as values.
 * @param query The search query to be used to find relevant books.
 * @return A list of book names matching the search query.
 */
fun searchBooks(library: Map<String, Int>, query: String): List<String> {
/**
 * Function to search the books in the library based on the given query.
 *
 * @param library A dictionary representing the library with book names as keys and quantities as values.
 * @param query The search query to be used to find relevant books.
 * @return A list of book names matching the search query.
 */
fun searchBooks(library: Map<String, Int>, query: String): List<String> {

    val matchingBooks = mutableListOf<String>()
    
    // Iterate through each book in the library
    for (book in library.keys) {
        // Check if the query is found in the book name or not
        if (query.toLowerCase() in book.toLowerCase()) {
            // Append the book name to the matching books list
            matchingBooks.add(book)
        }
    }
    
    return matchingBooks
}