/**
 * Given two lists, create a new list and a new set that contains the common elements of both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return Pair<List<Any>, Set<Any>> A pair containing a list and a set with the common elements of list1 and list2.
 */
fun createIntersectionListAndSet(list1: List<Any>, list2: List<Any>): Pair<List<Any>, Set<Any>> {

    // Find the common elements between the two lists
    val intersectionList = list1.filter { it in list2 }

    // Convert the list into a set
    val intersectionSet = intersectionList.toSet()

    return Pair(intersectionList, intersectionSet)
}
/**
 * Given two lists, create a new list and a new set that contains the common elements of both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return Pair<List<Any>, Set<Any>> A pair containing a list and a set with the common elements of list1 and list2.
 */
fun createIntersectionListAndSet(list1: List<Any>, list2: List<Any>): Pair<List<Any>, Set<Any>> {
/**
 * Given two lists, create a new list and a new set that contains the common elements of both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return Pair<List<Any>, Set<Any>> A pair containing a list and a set with the common elements of list1 and list2.
 */
fun createIntersectionListAndSet(list1: List<Any>, list2: List<Any>): Pair<List<Any>, Set<Any>> {

    // Find the common elements between the two lists
    val intersectionList = list1.filter { it in list2 }

    // Convert the list into a set
    val intersectionSet = intersectionList.toSet()

    return Pair(intersectionList, intersectionSet)
}