/**
 * You are an economist analyzing market data and you want to find the common elements in two tuples.
 * In this exercise, you need to implement a function called 'findCommonElements' that takes two tuples as arguments
 * and returns a new tuple containing the common elements found in both tuples.
 *
 * For instance, given the following tuples:
 *
 * tuple1 = listOf(10, 20, 30)
 * tuple2 = listOf(20, 40, 50)
 *
 * The function should return a new list:
 * [20]
 *
 * Your task is to complete the code to solve the exercise.
 */
fun findCommonElements(tuple1: List<Int>, tuple2: List<Int>): List<Int> {

    val commonElements = tuple1.filter { it in tuple2 }
    return commonElements
}
/**
 * You are an economist analyzing market data and you want to find the common elements in two tuples.
 * In this exercise, you need to implement a function called 'findCommonElements' that takes two tuples as arguments
 * and returns a new tuple containing the common elements found in both tuples.
 *
 * For instance, given the following tuples:
 *
 * tuple1 = listOf(10, 20, 30)
 * tuple2 = listOf(20, 40, 50)
 *
 * The function should return a new list:
 * [20]
 *
 * Your task is to complete the code to solve the exercise.
 */
fun findCommonElements(tuple1: List<Int>, tuple2: List<Int>): List<Int> {
/**
 * You are an economist analyzing market data and you want to find the common elements in two tuples.
 * In this exercise, you need to implement a function called 'findCommonElements' that takes two tuples as arguments
 * and returns a new tuple containing the common elements found in both tuples.
 *
 * For instance, given the following tuples:
 *
 * tuple1 = listOf(10, 20, 30)
 * tuple2 = listOf(20, 40, 50)
 *
 * The function should return a new list:
 * [20]
 *
 * Your task is to complete the code to solve the exercise.
 */
fun findCommonElements(tuple1: List<Int>, tuple2: List<Int>): List<Int> {

    val commonElements = tuple1.filter { it in tuple2 }
    return commonElements
}