/**
 * Given a map of book titles and their publication year,
 * this function finds and returns a list of books that have a publication
 * year different from the average publication year of all the books.
 */
fun findNotEqual(books: Map<String, Map<String, Int>>): List<String> {

    // Calculate the average publication year
    var totalYears = 0
    var numBooks = 0
    for ((_, bookInfo) in books) {
        val year = bookInfo["publication_year"] ?: 0
        totalYears += year
        numBooks++
    }

    val averageYear = totalYears.toDouble() / numBooks

    // Find books with publication year not equal to the average
    val notEqualBooks = mutableListOf<String>()
    for ((title, bookInfo) in books) {
        val year = bookInfo["publication_year"] ?: 0
        if (year != averageYear.toInt()) {
            notEqualBooks.add(title)
        }
    }

    return notEqualBooks
}
/**
 * Given a map of book titles and their publication year,
 * this function finds and returns a list of books that have a publication
 * year different from the average publication year of all the books.
 */
fun findNotEqual(books: Map<String, Map<String, Int>>): List<String> {
/**
 * Given a map of book titles and their publication year,
 * this function finds and returns a list of books that have a publication
 * year different from the average publication year of all the books.
 */
fun findNotEqual(books: Map<String, Map<String, Int>>): List<String> {

    // Calculate the average publication year
    var totalYears = 0
    var numBooks = 0
    for ((_, bookInfo) in books) {
        val year = bookInfo["publication_year"] ?: 0
        totalYears += year
        numBooks++
    }

    val averageYear = totalYears.toDouble() / numBooks

    // Find books with publication year not equal to the average
    val notEqualBooks = mutableListOf<String>()
    for ((title, bookInfo) in books) {
        val year = bookInfo["publication_year"] ?: 0
        if (year != averageYear.toInt()) {
            notEqualBooks.add(title)
        }
    }

    return notEqualBooks
}