/**
 * Given a range from start to end, find the missing numbers.
 *
 * @param start The starting number of the range.
 * @param end The ending number of the range.
 * @return A list containing the missing numbers.
 *
 * Example:
 * findMissingNumbers(1, 10) -> [2, 3, 4, 5, 6, 7, 8, 9]
 * findMissingNumbers(5, 15) -> [6, 7, 8, 9, 10, 11, 12, 13, 14]
 */
fun findMissingNumbers(start: Int, end: Int): List<Int> {

    val allNumbers = (start..end).toList()  // Create a list of all numbers in the given range
    
    // Prompt the user to enter numbers that are not available in the library's collection
    println("Enter the missing numbers in the library's collection (separated by commas):")
    val missingNumbers = readLine()?.split(',')?.map { it.toInt() } ?: emptyList()  // Convert the input to a list of integers
    
    // Find the missing numbers by subtracting the available numbers from all numbers
    return allNumbers.minus(missingNumbers)
}
/**
 * Given a range from start to end, find the missing numbers.
 *
 * @param start The starting number of the range.
 * @param end The ending number of the range.
 * @return A list containing the missing numbers.
 *
 * Example:
 * findMissingNumbers(1, 10) -> [2, 3, 4, 5, 6, 7, 8, 9]
 * findMissingNumbers(5, 15) -> [6, 7, 8, 9, 10, 11, 12, 13, 14]
 */
fun findMissingNumbers(start: Int, end: Int): List<Int> {
/**
 * Given a range from start to end, find the missing numbers.
 *
 * @param start The starting number of the range.
 * @param end The ending number of the range.
 * @return A list containing the missing numbers.
 *
 * Example:
 * findMissingNumbers(1, 10) -> [2, 3, 4, 5, 6, 7, 8, 9]
 * findMissingNumbers(5, 15) -> [6, 7, 8, 9, 10, 11, 12, 13, 14]
 */
fun findMissingNumbers(start: Int, end: Int): List<Int> {

    val allNumbers = (start..end).toList()  // Create a list of all numbers in the given range
    
    // Prompt the user to enter numbers that are not available in the library's collection
    println("Enter the missing numbers in the library's collection (separated by commas):")
    val missingNumbers = readLine()?.split(',')?.map { it.toInt() } ?: emptyList()  // Convert the input to a list of integers
    
    // Find the missing numbers by subtracting the available numbers from all numbers
    return allNumbers.minus(missingNumbers)
}