/**
 * This function takes in a list of floating-point numbers, a start index, and an end index.
 * It returns a new list that contains the elements of the original list from the start index (inclusive)
 * to the end index (exclusive).
 */
fun intersectionSlicingFloats(numbers: List<Float>, start: Int, end: Int): List<Float> {

    // Check if the start or end index is out of range
    if (start < 0 || start >= numbers.size || end < 0 || end > numbers.size) {
        throw IndexOutOfBoundsException("Start or end index is out of range")
    }

    // Check if the start index is greater than the end index
    if (start > end) {
        throw IllegalArgumentException("Start index cannot be greater than the end index")
    }

    // Slice the list to extract the desired elements and return the new list
    return numbers.subList(start, end)
}
/**
 * This function takes in a list of floating-point numbers, a start index, and an end index.
 * It returns a new list that contains the elements of the original list from the start index (inclusive)
 * to the end index (exclusive).
 */
fun intersectionSlicingFloats(numbers: List<Float>, start: Int, end: Int): List<Float> {
/**
 * This function takes in a list of floating-point numbers, a start index, and an end index.
 * It returns a new list that contains the elements of the original list from the start index (inclusive)
 * to the end index (exclusive).
 */
fun intersectionSlicingFloats(numbers: List<Float>, start: Int, end: Int): List<Float> {

    // Check if the start or end index is out of range
    if (start < 0 || start >= numbers.size || end < 0 || end > numbers.size) {
        throw IndexOutOfBoundsException("Start or end index is out of range")
    }

    // Check if the start index is greater than the end index
    if (start > end) {
        throw IllegalArgumentException("Start index cannot be greater than the end index")
    }

    // Slice the list to extract the desired elements and return the new list
    return numbers.subList(start, end)
}