/**
 * Given two lists of numbers representing the elevations of two mountain ranges,
 * find the intersection elevation point where the two ranges meet.
 *
 * @param a List of elevations in meters of the first mountain range
 * @param b List of elevations in meters of the second mountain range
 * @return The elevation in meters where the two mountain ranges intersect
 */
fun intersectionGeologyAddition(a: List<Double>, b: List<Double>): Double {

    // Find the intersection point by finding the maximum value from the first range
    // that is lower than the minimum value from the second range
    val intersectionPoint = a.filter { it < b.minOrNull() ?: Double.MAX_VALUE }.maxOrNull() ?: 0.0

    return intersectionPoint
}
/**
 * Given two lists of numbers representing the elevations of two mountain ranges,
 * find the intersection elevation point where the two ranges meet.
 *
 * @param a List of elevations in meters of the first mountain range
 * @param b List of elevations in meters of the second mountain range
 * @return The elevation in meters where the two mountain ranges intersect
 */
fun intersectionGeologyAddition(a: List<Double>, b: List<Double>): Double {
/**
 * Given two lists of numbers representing the elevations of two mountain ranges,
 * find the intersection elevation point where the two ranges meet.
 *
 * @param a List of elevations in meters of the first mountain range
 * @param b List of elevations in meters of the second mountain range
 * @return The elevation in meters where the two mountain ranges intersect
 */
fun intersectionGeologyAddition(a: List<Double>, b: List<Double>): Double {

    // Find the intersection point by finding the maximum value from the first range
    // that is lower than the minimum value from the second range
    val intersectionPoint = a.filter { it < b.minOrNull() ?: Double.MAX_VALUE }.maxOrNull() ?: 0.0

    return intersectionPoint
}