/**
 * Given two lists containing negative integers, return a new list that contains only the elements that are present in both lists.
 *
 * @param list1 The first list (contains negative integers)
 * @param list2 The second list (contains negative integers)
 * @return A new list containing only the common elements of list1 and list2.
 */
fun calculateIntersection(list1: List<Int>, list2: List<Int>): List<Int> {

    // Use set intersection to find common elements in the two lists
    val commonElements = (list1.toSet() intersect list2.toSet()).toList()

    // Return the sorted list of common elements
    return commonElements.sorted()
}
/**
 * Given two lists containing negative integers, return a new list that contains only the elements that are present in both lists.
 *
 * @param list1 The first list (contains negative integers)
 * @param list2 The second list (contains negative integers)
 * @return A new list containing only the common elements of list1 and list2.
 */
fun calculateIntersection(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Given two lists containing negative integers, return a new list that contains only the elements that are present in both lists.
 *
 * @param list1 The first list (contains negative integers)
 * @param list2 The second list (contains negative integers)
 * @return A new list containing only the common elements of list1 and list2.
 */
fun calculateIntersection(list1: List<Int>, list2: List<Int>): List<Int> {

    // Use set intersection to find common elements in the two lists
    val commonElements = (list1.toSet() intersect list2.toSet()).toList()

    // Return the sorted list of common elements
    return commonElements.sorted()
}