/**
 * This function takes two tuples as input and returns a new tuple containing the elements common to both tuples.
 *
 * @param tup1 The first input tuple.
 * @param tup2 The second input tuple.
 * @return A new tuple containing the common elements of both input tuples.
 *
 * Example:
 * intersectTwoTuples(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // Output: [3, 4]
 */
fun intersectTwoTuples(tup1: List<Int>, tup2: List<Int>): List<Int> {

    val commonElements = (tup1.toSet() intersect tup2.toSet()).toList()
    return commonElements
}
/**
 * This function takes two tuples as input and returns a new tuple containing the elements common to both tuples.
 *
 * @param tup1 The first input tuple.
 * @param tup2 The second input tuple.
 * @return A new tuple containing the common elements of both input tuples.
 *
 * Example:
 * intersectTwoTuples(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // Output: [3, 4]
 */
fun intersectTwoTuples(tup1: List<Int>, tup2: List<Int>): List<Int> {
/**
 * This function takes two tuples as input and returns a new tuple containing the elements common to both tuples.
 *
 * @param tup1 The first input tuple.
 * @param tup2 The second input tuple.
 * @return A new tuple containing the common elements of both input tuples.
 *
 * Example:
 * intersectTwoTuples(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // Output: [3, 4]
 */
fun intersectTwoTuples(tup1: List<Int>, tup2: List<Int>): List<Int> {

    val commonElements = (tup1.toSet() intersect tup2.toSet()).toList()
    return commonElements
}