/**
 * This exercise is designed for a biologist to practice finding the intersection between two number lines represented by ranges.
 * The function takes two number lines as input and returns the intersection of the two number lines.
 *
 * @param numberLine1 A pair representing the first number line in the form (start, end).
 * @param numberLine2 A pair representing the second number line in the form (start, end).
 * @return Pair<Int, Int>? The intersection of the two number lines represented as a range (start, end).
 *
 * Example:
 * numberLineIntersection(Pair(0, 10), Pair(5, 15)) // Output: Pair(5, 10)
 */
fun numberLineIntersection(numberLine1: Pair<Int, Int>, numberLine2: Pair<Int, Int>): Pair<Int, Int>? {

    val start = maxOf(numberLine1.first, numberLine2.first)  // Find the maximum starting point
    val end = minOf(numberLine1.second, numberLine2.second)  // Find the minimum ending point

    return if (start < end) {
        Pair(start, end)  // Return the intersection range
    } else {
        null  // Return null if there is no intersection between the number lines
    }
}
/**
 * This exercise is designed for a biologist to practice finding the intersection between two number lines represented by ranges.
 * The function takes two number lines as input and returns the intersection of the two number lines.
 *
 * @param numberLine1 A pair representing the first number line in the form (start, end).
 * @param numberLine2 A pair representing the second number line in the form (start, end).
 * @return Pair<Int, Int>? The intersection of the two number lines represented as a range (start, end).
 *
 * Example:
 * numberLineIntersection(Pair(0, 10), Pair(5, 15)) // Output: Pair(5, 10)
 */
fun numberLineIntersection(numberLine1: Pair<Int, Int>, numberLine2: Pair<Int, Int>): Pair<Int, Int>? {
/**
 * This exercise is designed for a biologist to practice finding the intersection between two number lines represented by ranges.
 * The function takes two number lines as input and returns the intersection of the two number lines.
 *
 * @param numberLine1 A pair representing the first number line in the form (start, end).
 * @param numberLine2 A pair representing the second number line in the form (start, end).
 * @return Pair<Int, Int>? The intersection of the two number lines represented as a range (start, end).
 *
 * Example:
 * numberLineIntersection(Pair(0, 10), Pair(5, 15)) // Output: Pair(5, 10)
 */
fun numberLineIntersection(numberLine1: Pair<Int, Int>, numberLine2: Pair<Int, Int>): Pair<Int, Int>? {

    val start = maxOf(numberLine1.first, numberLine2.first)  // Find the maximum starting point
    val end = minOf(numberLine1.second, numberLine2.second)  // Find the minimum ending point

    return if (start < end) {
        Pair(start, end)  // Return the intersection range
    } else {
        null  // Return null if there is no intersection between the number lines
    }
}