/**
 * This exercise aims to test your understanding of tuple methods and finding the intersection of two tuples.
 *
 * You are an electrician working with different sets of electrical components. Each set of components is represented by a tuple.
 * Your task is to write a function that finds the intersection of two tuples and returns a new tuple containing the common elements.
 *
 * For example, if the two tuples are:
 * t1 = (10, 20, 30, 40)
 * t2 = (30, 40, 50, 60)
 *
 * The expected output for this example would be:
 * (30, 40)
 *
 * Complete the function 'intersectionOfTuples' below to solve this exercise.
 */
fun intersectionOfTuples(t1: List<Int>, t2: List<Int>): List<Int> {

    // Use the 'toSet' function to convert the lists into sets
    val set1 = t1.toSet()
    val set2 = t2.toSet()

    // Use the 'intersect' method to find the common elements between the two sets
    val commonElements = set1.intersect(set2)

    // Convert the set back to a list
    return commonElements.toList()
}
/**
 * This exercise aims to test your understanding of tuple methods and finding the intersection of two tuples.
 *
 * You are an electrician working with different sets of electrical components. Each set of components is represented by a tuple.
 * Your task is to write a function that finds the intersection of two tuples and returns a new tuple containing the common elements.
 *
 * For example, if the two tuples are:
 * t1 = (10, 20, 30, 40)
 * t2 = (30, 40, 50, 60)
 *
 * The expected output for this example would be:
 * (30, 40)
 *
 * Complete the function 'intersectionOfTuples' below to solve this exercise.
 */
fun intersectionOfTuples(t1: List<Int>, t2: List<Int>): List<Int> {
/**
 * This exercise aims to test your understanding of tuple methods and finding the intersection of two tuples.
 *
 * You are an electrician working with different sets of electrical components. Each set of components is represented by a tuple.
 * Your task is to write a function that finds the intersection of two tuples and returns a new tuple containing the common elements.
 *
 * For example, if the two tuples are:
 * t1 = (10, 20, 30, 40)
 * t2 = (30, 40, 50, 60)
 *
 * The expected output for this example would be:
 * (30, 40)
 *
 * Complete the function 'intersectionOfTuples' below to solve this exercise.
 */
fun intersectionOfTuples(t1: List<Int>, t2: List<Int>): List<Int> {

    // Use the 'toSet' function to convert the lists into sets
    val set1 = t1.toSet()
    val set2 = t2.toSet()

    // Use the 'intersect' method to find the common elements between the two sets
    val commonElements = set1.intersect(set2)

    // Convert the set back to a list
    return commonElements.toList()
}