/**
 * Given a list of floating-point numbers and a target number, this function
 * returns the index of the first occurrence of the target number in the list.
 *
 * @param floatingPointNums A list of floating-point numbers.
 * @param targetNum The target number to search for.
 * @return The index of the first occurrence of the target number in the list.
 *         Returns -1 if the target number is not found in the list.
 */
fun intersectionIndex(floatingPointNums: List<Double>, targetNum: Double): Int {

    // Iterate through each element in the list
    for ((index, num) in floatingPointNums.withIndex()) {
        // Check if the absolute difference between the current number and the target number is less than a very small value
        if (Math.abs(num - targetNum) < 1e-9) {
            return index  // Return the index of the first occurrence of the target number
        }
    }
    return -1  // Return -1 if the target number is not found
}
/**
 * Given a list of floating-point numbers and a target number, this function
 * returns the index of the first occurrence of the target number in the list.
 *
 * @param floatingPointNums A list of floating-point numbers.
 * @param targetNum The target number to search for.
 * @return The index of the first occurrence of the target number in the list.
 *         Returns -1 if the target number is not found in the list.
 */
fun intersectionIndex(floatingPointNums: List<Double>, targetNum: Double): Int {
/**
 * Given a list of floating-point numbers and a target number, this function
 * returns the index of the first occurrence of the target number in the list.
 *
 * @param floatingPointNums A list of floating-point numbers.
 * @param targetNum The target number to search for.
 * @return The index of the first occurrence of the target number in the list.
 *         Returns -1 if the target number is not found in the list.
 */
fun intersectionIndex(floatingPointNums: List<Double>, targetNum: Double): Int {

    // Iterate through each element in the list
    for ((index, num) in floatingPointNums.withIndex()) {
        // Check if the absolute difference between the current number and the target number is less than a very small value
        if (Math.abs(num - targetNum) < 1e-9) {
            return index  // Return the index of the first occurrence of the target number
        }
    }
    return -1  // Return -1 if the target number is not found
}