/**
 * Given a list of all books in a library and a list of damaged books, 
 * return a list of all undamaged books.
 *
 * @param books A list of strings representing all books in the library.
 * @param damagedBooks A list of strings representing the damaged books.
 * @return A list of strings representing all undamaged books.
 *
 * Example:
 * books = ["Harry Potter", "To Kill a Mockingbird", "1984", "Pride and Prejudice"]
 * damagedBooks = ["1984", "Pride and Prejudice"]
 * findUndamagedBooks(books, damagedBooks) // Output: ['Harry Potter', 'To Kill a Mockingbird']
 */
fun findUndamagedBooks(books: List<String>, damagedBooks: List<String>): List<String> {

    val undamagedBooks = mutableListOf<String>()

    for (book in books) {
        if (book !in damagedBooks) {
            undamagedBooks.add(book)
        }
    }

    return undamagedBooks
}
/**
 * Given a list of all books in a library and a list of damaged books, 
 * return a list of all undamaged books.
 *
 * @param books A list of strings representing all books in the library.
 * @param damagedBooks A list of strings representing the damaged books.
 * @return A list of strings representing all undamaged books.
 *
 * Example:
 * books = ["Harry Potter", "To Kill a Mockingbird", "1984", "Pride and Prejudice"]
 * damagedBooks = ["1984", "Pride and Prejudice"]
 * findUndamagedBooks(books, damagedBooks) // Output: ['Harry Potter', 'To Kill a Mockingbird']
 */
fun findUndamagedBooks(books: List<String>, damagedBooks: List<String>): List<String> {
/**
 * Given a list of all books in a library and a list of damaged books, 
 * return a list of all undamaged books.
 *
 * @param books A list of strings representing all books in the library.
 * @param damagedBooks A list of strings representing the damaged books.
 * @return A list of strings representing all undamaged books.
 *
 * Example:
 * books = ["Harry Potter", "To Kill a Mockingbird", "1984", "Pride and Prejudice"]
 * damagedBooks = ["1984", "Pride and Prejudice"]
 * findUndamagedBooks(books, damagedBooks) // Output: ['Harry Potter', 'To Kill a Mockingbird']
 */
fun findUndamagedBooks(books: List<String>, damagedBooks: List<String>): List<String> {

    val undamagedBooks = mutableListOf<String>()

    for (book in books) {
        if (book !in damagedBooks) {
            undamagedBooks.add(book)
        }
    }

    return undamagedBooks
}