/**
 * This function takes the start and stop parameters of two gene sequences and returns the intersection of the regions.
 *
 * @param start1 The starting position of the first gene sequence.
 * @param stop1 The stopping position of the first gene sequence.
 * @param start2 The starting position of the second gene sequence.
 * @param stop2 The stopping position of the second gene sequence.
 * @return A list containing the start and stop positions of the intersecting region.
 *
 * Example:
 * findIntersectingGenes(100, 200, 150, 250) // [150, 200]
 */
fun findIntersectingGenes(start1: Int, stop1: Int, start2: Int, stop2: Int): List<Int> {

    val intersectStart = maxOf(start1, start2)
    val intersectStop = minOf(stop1, stop2)

    if (intersectStart > intersectStop) {
        return listOf()
    }

    return listOf(intersectStart, intersectStop)
}
/**
 * This function takes the start and stop parameters of two gene sequences and returns the intersection of the regions.
 *
 * @param start1 The starting position of the first gene sequence.
 * @param stop1 The stopping position of the first gene sequence.
 * @param start2 The starting position of the second gene sequence.
 * @param stop2 The stopping position of the second gene sequence.
 * @return A list containing the start and stop positions of the intersecting region.
 *
 * Example:
 * findIntersectingGenes(100, 200, 150, 250) // [150, 200]
 */
fun findIntersectingGenes(start1: Int, stop1: Int, start2: Int, stop2: Int): List<Int> {
/**
 * This function takes the start and stop parameters of two gene sequences and returns the intersection of the regions.
 *
 * @param start1 The starting position of the first gene sequence.
 * @param stop1 The stopping position of the first gene sequence.
 * @param start2 The starting position of the second gene sequence.
 * @param stop2 The stopping position of the second gene sequence.
 * @return A list containing the start and stop positions of the intersecting region.
 *
 * Example:
 * findIntersectingGenes(100, 200, 150, 250) // [150, 200]
 */
fun findIntersectingGenes(start1: Int, stop1: Int, start2: Int, stop2: Int): List<Int> {

    val intersectStart = maxOf(start1, start2)
    val intersectStop = minOf(stop1, stop2)

    if (intersectStart > intersectStop) {
        return listOf()
    }

    return listOf(intersectStart, intersectStop)
}