/**
 * This function takes two lists of integers as input and returns the common elements (intersection) between them.
 */
fun calculateOverlap(list1: List<Int>, list2: List<Int>): List<Int> {

    // Use the range function to generate a list of integers within a specified range
    val rangeList1 = (list1.minOrNull()!!..list1.maxOrNull()!!).toList()
    val rangeList2 = (list2.minOrNull()!!..list2.maxOrNull()!!).toList()

    // Creating a set of common elements between list1 and list2 using intersection
    val commonElements = rangeList1.intersect(rangeList2).toList()

    return commonElements
}
/**
 * This function takes two lists of integers as input and returns the common elements (intersection) between them.
 */
fun calculateOverlap(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * This function takes two lists of integers as input and returns the common elements (intersection) between them.
 */
fun calculateOverlap(list1: List<Int>, list2: List<Int>): List<Int> {

    // Use the range function to generate a list of integers within a specified range
    val rangeList1 = (list1.minOrNull()!!..list1.maxOrNull()!!).toList()
    val rangeList2 = (list2.minOrNull()!!..list2.maxOrNull()!!).toList()

    // Creating a set of common elements between list1 and list2 using intersection
    val commonElements = rangeList1.intersect(rangeList2).toList()

    return commonElements
}