/**
 * You are a librarian managing a library. The library has a collection of books and a list of users.
 *
 * You want to remove all the books that are not borrowed by any user. Implement the function 'booksToRemove`
 * which takes two arguments: a set 'books" containing the book titles and a set 'users" containing the user names.
 * The function should return a set containing the titles of the books that should be removed from the library,
 * i.e., the books that are not borrowed by any user.
 *
 * Example:
 * books = setOf("Book A", "Book B", "Book C", "Book D", "Book E")
 * users = setOf("User A", "User B", "User C")
 *
 * booksToRemove(books, users) -> setOf("Book A", "Book B", "Book C")
 */
fun booksToRemove(books: Set<String>, users: Set<String>): Set<String> {

    val borrowedBooks = books.filter { book -> users.all { user -> book !in user } }.toSet()
    return borrowedBooks
}
/**
 * You are a librarian managing a library. The library has a collection of books and a list of users.
 *
 * You want to remove all the books that are not borrowed by any user. Implement the function 'booksToRemove`
 * which takes two arguments: a set 'books" containing the book titles and a set 'users" containing the user names.
 * The function should return a set containing the titles of the books that should be removed from the library,
 * i.e., the books that are not borrowed by any user.
 *
 * Example:
 * books = setOf("Book A", "Book B", "Book C", "Book D", "Book E")
 * users = setOf("User A", "User B", "User C")
 *
 * booksToRemove(books, users) -> setOf("Book A", "Book B", "Book C")
 */
fun booksToRemove(books: Set<String>, users: Set<String>): Set<String> {
/**
 * You are a librarian managing a library. The library has a collection of books and a list of users.
 *
 * You want to remove all the books that are not borrowed by any user. Implement the function 'booksToRemove`
 * which takes two arguments: a set 'books" containing the book titles and a set 'users" containing the user names.
 * The function should return a set containing the titles of the books that should be removed from the library,
 * i.e., the books that are not borrowed by any user.
 *
 * Example:
 * books = setOf("Book A", "Book B", "Book C", "Book D", "Book E")
 * users = setOf("User A", "User B", "User C")
 *
 * booksToRemove(books, users) -> setOf("Book A", "Book B", "Book C")
 */
fun booksToRemove(books: Set<String>, users: Set<String>): Set<String> {

    val borrowedBooks = books.filter { book -> users.all { user -> book !in user } }.toSet()
    return borrowedBooks
}